Hacker News new | ask | show | jobs
by peteforde 5007 days ago
I've been putting off porting an iOS app to Android specifically because of my fear of testing on so many devices.

While I'm sad that there are 43 (and counting) possible variations, this looks solid and helpful — I'm much more likely to attempt my port project now.

3 comments

Get a low-end (HTC Legend), a mid-end (HTC Desire / Moto Droid), and a high-end (Samsung Galaxy Nexus or S-II/III) device, and you are good to go. Also get a cheap tablet if you need to support that. Always develop on the lowest end device as a rule, and the optimizations you apply to make it usable on it will make the app super snappy on higher end devices. Choose Android 2.2 as your target platform and you include 96% of Android devices: http://developer.android.com/about/dashboards/index.html

Always use dp instead of px, use dynamic layouts (like HTML/CSS) instead of absolute ones (like in iOS), use 9-patch or XML drawables wherever you can, don't fight the framework. Use the compatibility library for fragment support and other cool stuff, and use them wherever you can. Be careful about bitmap memory consumption, that's a gotcha on low-memory devices.

If you don't mess around with low-level stuff like NDK or OpenGL you should be good to go on the very most devices. The well-tread Java API paths are not as scary as some blogs want to make you believe. You don't have to own all the 10k devices which exist, because most of them have stock Android installed. For special cases you will receive stacktraces from people's devices in the Play dev console - or you use one of those crashlog services.

highest density of good advice i've seen in a long time
by moto droid do you mean the original moto droid? if so, i'd think by now the 2+ year old handset would be considered low end
Yes, the original one. No, HTC Legends are still around, those are the real low ends, also in terms of display resolution.
Some of the noise you hear is precisely that. The ways in which your application can fail will depend on the sort of things it does. Generally if you follow Android best practises you will be fine. On the other hand if you pretend it is a dumb iOS device you'll have trouble. For example if you do screen layout using pixels you'll be digging a big hole.

As for testing, things can be easier. Unlike iOS provisioning profiles you can give the application package (apk) to anyone and they can sideload it onto their device (even from following a web browser link). They just have to change one setting to allow this. This means you can distribute your app for testing to friends, family and others easily. When you put the app on the Play Store you can also restrict it. If you think there could be major compatibility issues then make it available only a small subset of countries/carriers/devices and increase as you get more comfortable.

See this talk https://www.youtube.com/watch?v=Erd2k6EKxCQ (22 minutes in if you want to skip the big picture) for how you can preview your UI across a multitude of languages and form factors.

There are places that let you test with devices remotely. This is especially useful if you need to check things out in other countries. One example is http://www.perfectomobile.com (not an endorsement). Samsung also has something http://developer.samsung.com/remoteTestLab.do

You can easily outsource testing too if it matters that much to you.

A good source of devices is http://swappa.com

I personally use 6 devices. G1 (Android 1.6), HTC something (Android 2.1), Droid (Android 2.2), different Droid (Android 2.3), Galaxy Tab (Android 4) and Galaxy Nexus (Android 4.1).

You can certainly start out supporting only a subset of Android versions (eg 2.3 onwards) and then based on user feedback figure out where to go next.

I had the same fear as you, initially. It's true that there are a lot of possible devices, versions, screen sizes etc. But in all reality, you mostly need to care about 2-3 devices.

- OS: Android 2.2/2.3 and 4.x. (Rest doesn't matter, honestly)

- Device sizes: a big/new samsung galaxy-sized one (~ 1200x700), one 320x480 and maybe a smaller one.

Depends a bit on your target demography.

This isn't actually too much worse than what you have with iOS these days, where you have retina + non-retina + tall device. (possibly + iPad). And possibly 3 iOS versions to think about - 4.3, 5.1 and 6.0.