Saturday, January 5, 2008

Challenges of Android Development

It is always nicer to read the opinions and experiences of developers actually working on Android, compared to the commentary of bloggers / reporters who get their development-related information second hand.

Nazmul Idris of the Developerlife blog seems to have waited over a month after initial release to check out the Android SDK and he's been at it for only a couple of days now. Nevertheless, his Google Android Musings about the challenges of developing for a mobile platform in general, and for the Android platform in particular makes some worthwhile reading:
In Android, there is no Swing or AWT, so you have to familiarize yourself with the new GUI APIs (hierarchically nested Views) that are part of Android. That’s not so bad… since they have lots of pre-built widgets, and they provide lots of data binding support for diverse data models. Having said that, the biggest difference in building an Android app, from one that runs on a desktop/server/laptop Java VM is that the Android app runs in a managed container. The SystemManager is responsible for taking the app through various discretely defined lifecycle states, which allows for apps to be interrupted by network coverage issues, or incoming phone calls, or just being turned off, as examples. An Android app that has a UI is called an Activity. Activities run in their own Linux process, and they have one default thread (Swing-like-EDT), that can not be hogged for more than 5 seconds, otherwise, the SystemManager will shut the app down. This requires users to know how to create background tasks, which is not easy. Also, the UI metaphor in Android is one of building “screens”, rather than building apps which have nested panels and complex layouts and centralized state management. This is a very common approach to taken when building UIs/apps for mobile devices. The idea is to split up an application into many discrete loosely coupled pieces… some that are bound to the screen (Activity), and others that are “headless” (Services). Additionally, there are lots of container managed persistence and data exchange mechanisms that are available. However, given that these pieces can be swapped out with different pieces, and that any screen can be paused or activated at any time makes life more tricky for the app developer. All of this raises the barrier to entry so to speak. And I’m not even going into the optimization techniques that you have to adopt to write code that runs fast.

The above quote is just a small part of the article. Visit the blog to read some more on the topic.


No comments: