Am I writing in thinking that an apk that has been built and tested on one Android device can be sent to someone else using a different type of Android device and it should still work?
i.e. Titanium compiles once - and it works on all platforms?
That had been my understanding, but I am finding that an app I have been testing on my HTC phone (android) is either not working or looking extremely odd on my customer's Galaxy tablet and Motorola phone. Is it a matter of updating all the Packages in the SDK manager?
Stepping through your last comment:
- A single APK will be deployed to the app store and will run on all the devices.
- The different SDK packages allow you to build and deploy using those SDK features and APIs.
- Always test on as many devices as possible. In certain cases you may need to branch some code to target specific devices/resolutions/densities.
Titanium makes it very easy for you to do all the things you need to do in order to handle the various form factors, densities ect. All this is described in-depth in the docs, which someone was kind enough to give you the link to above. More resources for dealing with this can also be found in the docs:
Welcome to the world of pain that is Android fragmentation.
It's: Build once, modify everywhere (c)
you would have to deal with this natively as well, you need to keep in mind various resolutions and screen sizes as you develop.
Android devices differ in many ways and there's no way to really build once and it works on everything. Differences in android versions, hardware, and firmware can easily break an app that seems to be working on one device.
Test on as many devices as possible and definitely test on as many emulators as possible. Use the DDM to debug, there may be a memory warning that isn't crashing the app on your phone but is on another phone.
Also an HTC phone, Galaxy tablet and Motorola phone are extremely vague device descriptions, which actual devices are being used for testing? Which version of android?
Many thanks for all answers. It's hard to phrase my question exactly...but what I am wondering is whether a single apk is expected to run on multiple devices (admittedly with layout issues) - or do I need to create a different apk for each target device? In languages I have used in the past, I have vague memories of compiling seperately for different target devices, so I wondered if this was a similar thing.
Or is the point of the difference Packages for the SDK just to enable you to test in various emulator formats? And you should test on multiple devices as you develop and split the code off to various branches to accomodate a range of target devices?
How do you manage specifying layouts for each resolution/screen size? Do you have various versions of the file (i.e. one for each target device) or do you branch the code? I can imagine branching code gets very messy very quickly as you would be applying tests and coding various layouts every time you put a single button on a page!
yes, only a single APK. 'maybe' 2 (one for phones and one for tablets) but even that i wouldn't suggest. You can branch code off to have separate paths, however there is usually a path where that can be avoided in most instances. using layout properties on views and windows, and using relative/dp sizes rather then absolute pixels.
Many thanks for all the replies - it has been very helpful :)
Think you can help? Login to answer this question!