It can be very tempting to release your Android app immediately after you finish it. You want it to be available for download on the Android Market as soon as possible, right?
On the other hand, you don’t want to get a lot of bad reviews because you left in a lot of bugs. It is much better to find and fix bugs before you release your app than to have your users find them for you.
How should you go about testing, then? There are several types of testing that you should do.
Testing your basic use cases
First, do some testing in the emulator. Fire up your favorite AVD (or create one if needed – see the Android developer site for detailed instructions). Verify that it indeed looks as you intended.
Your layouts should look correct in the emulator, including any ads you are showing (such as MobFox). If so, everything is working! It is important to test different resolutions and orientations to verify that it always looks as you expect. Test all activities that you have set up to show ads.
Go through the normal use of your application and verify that everything works and looks as you intended, and that the ads haven’t affected the operation of the app.
A more robust test than just pressing a few buttons is to use the automated testing program for Android, called the Monkey. This simulates any number of random actions that you select, allowing you to see if bad behavior can trigger a crash. This is much better than your own testing, because you’re not likely to intentionally do things “wrong”. Users, however, may not know the correct way to use your app and can do very unpredictable things.
You should always use the Monkey before releasing your app, and verify that it can’t cause your app to force close. Read the instructions here to use the Monkey:
Testing on real devices
Before deploying your app, it is also important to test on a real device. Test all of the functionality on this device as well, to ensure that it behaves the same as on the emulator.
For each target device that you don’t have access to, be sure to create an AVD with the same settings. For example, how does your app behave on different Android versions, or with different screen sizes? How about a WiFi-only device?
I discovered the hard way, after I got a Xoom tablet, that my app force-closed every time on the tablet. Why? I hadn’t tested on any WiFi-only device configurations. Luckily the bug was easy to fix, but I’ll never know how many tablet users saw that crash and uninstalled my app forever. See here for more details on that adventure.
By the way, you don’t need to purchase Google’s official developer phones to have a test device. They can be rather expensive. You can find a selection of unlocked devices to buy for testing.
Testing by others
Another good option is to get friends and colleagues to help you test your app. Extra pairs of eyes can help spot things that you don’t.
Going further, there are services that will perform testing for you. I haven’t reviewed these services yet, so I can’t give you specific advice on how well they work. I’ll work on getting information on these services in a future post.
Now it’s time for release
After fixing all issues you find in any of these tests, you should have a great deal more confidence that your app will work for the myriad of devices and configurations that users of your app could have. Now it’s time to move on to the next step.
If you’re looking for more help in getting your app deployed, be sure to take a look at the Android Income Powerstart Guide for guidance from start to finish on building an Android app.