There are times when I actually envy iPhone developers! With a very limited number of version / screen size combinations, testing is relatively straightforward. The very same thing that has made the Android platform so successful: near endless variety of hardware makes testing a serious challenge.
In an ideal world we would test Android apps on every possible combination of hardware and operating system version. Given the massive diversity of the Android ecosystem this is simply not an option. How then should we tackle this challenge?
One option is to target a very small set of devices / versions which are supported by your application and test against this set. The Play store (formerly known as the Android Market) supports this by hiding Apps which will not run on a consumer’s device. The problem with this approach is that you are limiting potential sales to a fragment of the potential market.
Most Android apps are targeted at a broader range of hardware than the developer can possible have available. How then do they do that? How can they guarantee their application will run on every platform? The answer lies in using Android Virtual Devices (AVD). AVDs allow Android devices to be emulated on a PC running Windows, Linux or OS/X.
The Android SDK provides an AVD manager tool which allows the developer to create new AVD images on which to test. The developer specifies crucial information such as which Android version to target, the screen size and resolution, the available memory and what additional hardware / sensors are available. Once created and started, the AVD appears on the desk-top of the development machine and fully integrates with the other Android development tools. The developer can then deploy their application, run it and debug it in a realistic simulation of a real device.
There are a few caveats to bare in mind:
If you want to find out more about testing Android applications on AVD’s, you could try Learning Tree’s Developing Applications for Android ™ Devices course. It provides a great opportunity to experiment in a controlled environment.