A question which I am often asked is how Android development compares with developing for the iPhone/iPad. The two platforms are indeed very different in the approach they take, with a consequent variation in the developer challenges. In this post, I will explore just a few of the issues. I should start by making it clear that this is written very much from the perspective of an Android developer exploring iOS and will inevitably reflect some bias caused by a greater familiarity with the Android platform.
Perhaps the biggest challenge in comparing the two platforms is where to start. Let’s take a look at something really basic: the programming language. Android applications are written in Java and executed by the Dalvik interpreter whilst iOS is compiled into native code from Objective C. Whilst it’s possible to argue the pros and cons of these two approaches, I’ll leave that well alone. From my perspective as a long-time Java programmer, moving to Objective C seems like a giant leap back into the past!
Don’t get me wrong, Objective C produces well structured, efficient code but OMG: all those header files, linking errors and a general lack of compile time validation makes life hard. I suppose that you could argue that it’s just that using Java with the Android Development Tools (ADT) makes you lazy. My experience however is that I have made numerous small errors which the Java tools would have picked up at build time but in iOS, they become hard to identify run-time errors.
To balance things, there is one feature of iOS 5 which I really like and that is the Storyboard. The Storyboard editor provides a visual overview of all of the screens in your application and the navigation between them. Like any visual tool, there is a learning curve but once you gain familiarity with the tool it gives a really great overview of the interaction between the various views of your application. From within the editor, you can specify the transitions (segues in Apple lingo) between the screens and even map the fields of a view to the underlying code using drag & drop. This is one tool that I really hope that the Android developers think about creating an equivalent of.
There is loads more to say on the difference between the two platforms and I’ll probably revisit the area in a future post. For now, I’ll sign off, leaving you with the thought that Learning Tree has several excellent courses covering both Android and iOS development.