Android Headaches

Just a few problems to keep in mind, whenever you’re developing for Android.

Sensors! Some devices have a plethora of usable sensors. Some have few sensors at all. Some (like my phone!) have relevant sensors, but they’re extremely rigid, and mostly unusable. If you’re using any kind of sensor, always think twice about if it is something that is really necessary, and test it on many devices. For some, it’ll be fine, but for others, it’ll be like my phone’s useless light sensor and only pick up one of 3 values.

Layouts! Not only do you have to consider portrait and landscape layouts, but also you have to keep in mind how your app looks in all sorts of different shapes and sizes. Unlike iOS, where there are only like 3 form factors, Android can come in more form factors than you could imagine. Different phones, tablets, consoles, TVs, refrigerators, you have to keep (most) of them in mind when developing a UI!

Code! Always check and double-check your code when you get a run-time error before trying to make sweeping changes. I couldn’t count on one hand the amount of times I have run into a problem and proceeded to try and change half of my app to get it working, only to find out it was something like not capitalizing a permission correctly. There are countless ways to make your app stop cold in its tracks that involve a capitalization error, or a simple typo, and 99% of the time it’ll compile correctly and leave you searching for hours.

These are just a few problems that I ran into often while trying to program for this class. There are many, many more pitfalls such as performance on different devices and Eclipse troubles (phantom errors that only go away when you clean your project…), but I’ll leave it at this for now.