Language and Framework Features
This is the second post of our five-part series on Android vs. iOS development from our microProduct Lead, Mark Oldytowski.
Android vs. iOS, the debate that stirs the same emotions as the RedSox vs. the Yankees, Ali vs. Frazier, and South Park vs. Family Guy. Everyone has a side, and everyone will defend it until the bitter end.
Now that your environment is setup and ready to go, it’s time to start coding! For the purpose of this blog, we’re going to focus on the native language for each platform: Java for Android and Objective-C for iOS. In reality, you could choose from a myriad of other languages for each; some officially supported and many others maintained by third party companies or open source. We’ll ignore those for now and just stick with the core languages since they offer the most complete and up-to-date access to the device framework features.
We’ll start with Android, which uses the Java language syntax, but is not built on top of the Sun JVM / Java SDK. This is important because it means that while you are writing code in the Java syntax, many features available in the Java SDK may not be available within the Android SDK, and vice versa.
Using the more modern and universally taught Java language gives Android some distinct advantages from Objective-C. For one, the number of open source libraries written in Java is enormous, and many of these can be leverages for Android development either directly or with some slight tweaking. Java also includes a few language features missing from Objective-C, such as generics, anonymous classes, and package declarations (you’ll miss them when you don’t have them). And of course, Java removes the concept of pointers in favor of using references, simplifying things for everybody involved.
Objective-C development for iOS, on the other hand, has slightly more archaic roots. It’s a superset of the C language, mixed with Smalltalk syntax, so it’s unlike anything you have likely experienced (unless you were a Smalltalk developer in a past life). Ramp up time for a new developer on an iOS project is going to be significantly higher due to the learning curve associated with the syntax and style conventions.
In addition to some core language features missing from Objective-C, there are a few other oddities. In the past, developers had to manually release every object that was allocated in memory or else suffer from dreaded memory leaks. It is a good thing for developers that Automatic Reference Counting (ARC for short) was introduced in iOS 5. The problem is that there is a mix of ARC and non-ARC libraries and documentation out in the world, so the developer has to take care when mixing the two. Also, the dynamic nature of the Objective-C language can provide a large amount of versatility for an experienced developer, but one who is not as familiar with it can get into trouble quickly and become very confused while reading the code from another developer (what object type is inside this array??).
As far as frameworks are concerned, both the Android and iOS SDKs have similar core and device features. You will have support for notifications, maps, camera, geolocation, contact list, calendar, web service interaction, some type of data storage, and support for different states of the app (background, foreground, call received). A big advantage that iOS has is a uniform nature: every device runs the same OS (sans version) with a very defined set of hardware. Android, on the other hand, is a very open hardware and software platform. Hardware vendors can skin the OS with their own flavors and change default programs, potentially causing chaos at times when you try to access something that the vendor changed (custom calendar, camera, etc).
IOS development also has a big “gotcha” that I have run into many times myself: Apple has a tendency to deprecate core framework methods and kill the previous functionality between OS revisions with little forewarning. Recently, this occurred on the iOS7 to iOS8 upgrade where they changed the way that a user subscribes to device notifications and asks for permission for the location services. It didn’t matter which version of the OS you targeted during development, all a user had to do was upgrade the OS on their device and the functionality would break for your app. This is one of the big reasons there is a huge rush of app updates released whenever a new OS version is updated. Be diligent and stay on top of the releases before they hit the devices to make sure your app is still functioning properly
|+ Java – easy ramp up time for most devs||+ Core framework features|
|+ Core framework features||+ Uniform device and OS cause fewer mystery bugs|
|+ Third party libraries-a-plenty||
– Deprecate functionality at will
|– Vendor changes can cause issues with the framework||
– Objective-C syntax and missing features… enough said
Stay tuned for Part 3, UI Design Tools and Controls
Read Part 1: Development Environment and Project Setup