A stack of techical books

"There's No Silver Bullet"

We believe in methods that amplify learning, communication and collaborative teamwork. Methods that help us do our job better and faster.

In this section our experts share their insights and experience.

Articles

Reaktor Twitter

Android and iOS Platforms

An experienced developer groks mobile platforms quickly

Mobile devices based on the Android and iOS platforms have gained popularity in the recent years. By the end of 2010, roughly half of all smart phones were running Android or iOS.

A developer interested in mobile will get comfortable with both of these mobile platforms. This article presents some of our experiences from mobile application development projects.

Android has an air of familiarity to the Java developer

Developers coming from the Java ecosystem will be up and running with Android in no time. Being able to use the same familiar tools, such as Eclipse and IntelliJ IDEA, and the same familiar libraries as with desktop and server-side application development is a significant boon to learning. Besides Java, one can also choose to make use of alternative JVM programming languages that offer more power of expression, such as Scala, Clojure and JRuby.

For the programmer who's done component-based development with Java Swing, for example, Android's user interface implementation model is second nature. Layout and positioning is more limited than with popular third party components for Swing but the design and principles are the same.

Creating Android user interfaces involves a lot of declarative XML, which brings the usual challenges of “XML programming” in dividing responsibility and in duplication for example. User interface components can be built programmatically, too, but the Android platform with its documentation and tooling is somewhat partial to XML-based layouts.

A beginning Android developer needs to dive straight to the deep end when it comes to concurrency. Even the smallest background processing often need to be done in a dedicated thread to keep the user interface responsive.

High variety of Android devices amplifies the need for manual testing

During development, Android applications can be tested on the device and in an emulator that's part of the Android SDK. For the most part, the Android emulator is reliable, but different phones do have slightly different layouts, which entails a lot of manual work in testing.

The build process and deployment into a device differ somewhat from web development. The compilation of an Android application involves preprocessing the XML layouts and code generation that requires Android-specific tools. Documentation for both the platform and the toolchain is mostly good, although the signs of aging and the increasing number of revisions to the platform is starting to show.

iOS development may seem strenuous at first

The lingua franca of developing for the iOS platform is Objective-C and the majority of developers use Apple's own integrated development environment, Xcode, which is fairly accessible to the beginner. If the C/C++ world isn't in your DNA, the low level of abstraction of Objective-C will probably provoke a few raised eyebrows. For example, programmers tend to spend quite a lot of time worrying about memory management. The wordy syntax also presents an additional challenge to keeping the code clean. The addition of support for dynamic blocks in iOS 4.0 brought some relief to these pains, though.

UI development is centered around Xcode's Interface Builder, which makes creating basic layouts almost trivial. As the user interface gets more complicated, however, so does the effort required. Managing the layout can be surprisingly laborious: a programmer who uses dynamically expanding components often has to lay out those components explicitly in code. The Model-View-Controller model at the core of iOS user interface API's has rough edges, too, and occasionally twists the programmer's hand, locating code in somewhat unintuitive places within the code base.

iOS deployment and testing is quick, managing certificates grueling

The simulator that comes as part of Xcode works very well for testing applications in development. Compilation and starting the simulator is a snap. Every now and then, however, slight differences can be seen in drawing graphics between the simulator and physical test devices. Otherwise, the simulator is very reliable.

Utilities for testing iOS user interfaces are seriously lagging behind web development but a satisfactory setup for regression testing the UI doesn't take too long to put in place. Suitable tools for automating such regression tests include, for example, UISpec and Frank.

Managing and updating the development certificates and provisioning profiles for iOS development can take a lot of time. In order to install the application on test devices, all developers need a individual certificate associated with the team's shared provisioning profile. All test devices must also be individually registered to the profile. Once the certificates are in check, though, deploying apps to test phones is straightforward.

It's easier to develop for Android than it is for iOS

Comparing the two mobile platforms from the developer's perspective, Android takes home the first prize. Many features that are considered basic in an IDE are still missing from Xcode. As of writing this, Xcode doesn't offer a way to find all usages of a given method in the code base, for example. The refactoring tools in Xcode are also a bit awkward to use and extremely limited compared to Eclipse and IDEA.

In terms of programming languages, Android gives the programmer more choices. All JVM languages work well on Android and most of those languages have a higher level of abstraction and more expressiveness than Objective-C. The development cycle, building and testing, on the other hand, is faster on iOS. Laying out simple user interfaces is easier in iOS but Android's approach to layouts tends to win programmers' hearts even with its flaws.

The Android platform is a notch more open compared to iOS. Using open source components, for instance, is easier than on iOS and developers can implement their custom protocols on the Android. On iOS, on the other hand, using Apple's own undocumented API's results in the application being rejected when submitted to the App Store.

Android provides for inter-application communication much smoother than iOS. With its intent mechanism, for example, sharing a photo on Facebook from within your application is just a handful lines of code: in your application trigger the ACTION_SEND intent with which the photo can be transmitted to the Facebook application.

When it comes to manual testing, the homogeneity of devices in the market simplifies the developer's job a lot. Because of the variety of devices available and their respective differences in layout or behavior, Android applications tend to require more time for manual testing.

Quality is quality regardless of the platform

In the end, both of these mobile platforms are just technologies. Learning and experimenting with new technologies should be business as usual for every programmer – and the iOS and Android platforms aren't any different. High quality code is high quality regardless of the platform it's written for and the language it's written in.

Tuomas Nikkinen closeup

Tuomas Nikkinen, technical project manager

Tuomas has specialized in delivering agile software project in mixed environments and with various technologies.

Jouni Hartikainen closeup

Jouni Hartikainen, software architect

Jouni's ambition is to employ agile methods in developing for all kinds of environments and using modern programming languages on mobile platforms.