Tuesday, 5 January 2016

Android Enlightenment

My New Year's resolution is to blog more.

It wouldn't be hard - my last post was in 2010. I should clarify, my last personal post was in 2010. I do blog on and off as my alter-ego CTO, Push Technology at www.pushtechnology.com. But company blogging doesn't allow you to establish a narrative or a following or any of those ego-enhancing things that the technorati cherish, but more about that another time.

I like blogs to be useful, informative, pithy, witty and above all correct. I shall aim to cover all of these in this inagural posting (pithy might be a stretch, but for the right reasons).

So Android.

I've had a few run-ins with Android in an earlier life. It's Java innit, but not as you know it Jim. It's got this generated dalvik stuff that's supposed to make it more compact and other good things, but in fact seems to make it more inflexible. It's got a so-sue-me-Oracle version of Java that's subtely different and broken in different ways to the way that the Oracle JDK is broken. It's got some standard libraries and others not-so-much. Then there's the SDK. I used to whine about the fruit company and it's walled garden, but at least the iOS SDK works in a relatively predicatable way. The Android SDK appears to work in a somewhat unpredictable and undocumented way. At some level that's ok - it's sort of open source and you can go and look at the code if you are really stumped, but it does add to the complexity and general drag involved in development.

And then there's the emulator.

Excuse me while I open the door and scream into the darkness.

On the good side the emulator works on a large number of platforms and generally seems to reasonably emulate what happens on a real device. It's just that it's so unbelievably slow. Ok so it has this Intel HAXM technology which is suppose to accelerate performance but it's still unbelievably slow. Unbearably slow.

So we have a platform that most of the connected world is using, but a platform that has any number of development pitfalls. So the absolute wrong way to develop for this platform would be to write-once run everywhere. Automate the hell out of it I say!

But how can you do this when the emulator is so slow? It get's worse - the only technology - HAXM - that has any hope of making automation usable is a virtualization technology and therefore will not work on top of other virtualization technologies - you know things like VMWare and Xen that you might possibly be using in your continuous integration environment.

But this is a success story. I have a solution, but in the spirit of Fermat you will have to wait for subsequent posts for the details.

Happy New Year!