Why I prefer iOS Development over Android, from a Java guy
I’ve pretty much always been on the Java bandwagon and I held it up as the greatest language the computing world has ever seen. I still believe that in many ways that Java is a superior, more robust language in many respects, but I wanted to throw a few points out there so folks can see why I preferred to broaden my horizons and delve more into iOS development instead of making the more logical progression into Android development with Java.
The Apple Platform
The principal reason that I chose iOS over Android was the platform. Apple products are stable, well tested and they just work right out of the box. At this point of the decision process, the Java vs. Objective-C argument didn’t even factor in. I just enjoy Apple products, they save me time and the products fit my needs better. When I work in Java, even though it is platform independent, I feel I still spend much of my time working through nuances of Windows vs. Unix-based systems.
Oracle’s Acquisition of Sun and Java
The saddest day perhaps of my Java career was the day that I heard that Oracle was purchasing Sun. I enjoy working on an Oracle database and I enjoy working in Java, but I have never enjoyed Oracle’s middle-tier solutions. They often feel like one-off implementations, they are often difficult to configure and turnaround time for developing applications is a lot like the mess that IBM has created with RAD and we all know how I feel about IBM. I believe that this news was the beginning of the end for Java. In the future, we will see Java fragment into several other flavors, much like Linux has. I loved Linux but the multiple flavors are the reason that it really didn’t take a greater foothold. If all the flavors of Linux had came together to create a unified front with a single Linux distro, we would have seen a greater dominance for the platform. At present, there are already IBM, Sun, OpenJDK JVMs, as well as a few premium versions like JRockit, out there, eventually, these will diverge further to the point that even the APIs will fork.
Oracle is also a very protective and litigious company and combine that with the news that Google copied Java code to create the Android runtime, you have a huge problem. Whether the code was unit testing code or Google didn’t ship it with Android makes absolutely no difference to Oracle lawyers. I would have been happier than a pig in slop if Google had purchased Sun and I would probably be doing Android development today.
The face of Java is changing. I am at the point where I would rather work on a .Net project than to have to suffer trying to work with Oracle and IBM related products. Say what you will about Microsoft, but they also got it right. The platform is very unified, much like the iOS platform and I also despise Microsoft, but I’ll give them props.
Language Performance
Objective-C is an ugly language when compared to Java. Java is a filet mignon to the ribeye that is Objective-C. Java has robust language support APIs like Collections. There is a collection for every purpose. I could go on and on about the features Java has that Objective-C doesn’t. I will throw in though that I can say the reverse in some cases. Objective-C for example has @property and @synthesize which automatically creates accessors and mutators and if Java had this, it would be huge.
Objective-C has some big advantages over Java in terms of performance. Java garbage collection is unpredictable and no matter who tells you that you don’t have to be concerned about memory, they are steering you wrong. I spend a lot of time in Java looking for objects that are held in memory in some bad code I wrote or some code that a junior developer wrote. Yes, no matter how much code I write, I still write some crazy stuff, it is part of being human. In Objective-C, memory issues are usually apparent up front, especially if you are writing applications for iPhones, for obvious reasons. In Objective-C, you should be aware about memory allocation and releasing from the very start. On the Mac, garbage collection is now a feature that you can turn on, but I don’t recommend getting used to it. Sure, go ahead and turn it on if you are experienced in the language, but continue to keep your habits of releasing objects when you are done.
Objective-C is really C, a flawed, but fantastic language that is so enormous, you could program in it your entire life and never completely learn everything it has to offer. Objective-C just makes the language object-oriented and adds a Smalltalk language spin on things. The benefits of C-based language is that it is fast. You just can’t compare operations in C to operations in Java. The Java virtual machine makes your code flexible for any platform, but at the cost of performance. On the Android, Dalvik replaces the standard Java virtual machine and you have a lot of JNI wrappers around C objects that make it perform better, but it is still a virtual machine.
This would be another reason to choose iOS over Android development because you ultimately have complete control, or lack thereof, of the performance of your application. I do agree that in most cases with developers who know what they are doing that the differences here will be minuscule.
Fragmentation of the platform
The greatest detraction when working on Android apps is the fragmentation of the platform and upgrade issues. There are many different versions of the Android OS and there are many different types of phones that have Android on them. If you are programming for Android, you need to choose a version of Android that you will support and a set of phones that you will support. Which leads to another problem with upgrades. The latest statistic is that iPhone users have a 90% probability of being on the latest version of iOS but Android users have less than .04% chance of being on the latest Android OS. This is mostly due to the tethering to iTunes and Apple being diligent about upgrading users and annoying them about doing it. With Android, you are reliant on the manufacturer of your phone to get the upgrade out there. The bad part is that if the latest Android OS has a feature you want to use, you are locked into coding to the previous OS, until all the phones you support have upgraded. Not something I want to be doing; I do enough of that with Java applications already.
I still get assigned to projects were people are using Java 1.3 or 1.4. Java 5 added so many countless features that make coding simpler and it is really disheartening to have to be locked into 1.4 APIs because no one bothered to keep up with releases. I can understand not wanting to be on the cutting edge with respect to upgrading, but these Java releases are so old, it is hard to even find a JVM anymore to run them. (Getting off my soapbox or I will continue forever….)
So, bottom line here is I don’t want to be coding for X number of phone on X flavors of Android OS when I can be coding for a single iPhone/iPad on a single OS version. I can certify my app on the latest iOS once that SDK is finalized and I can start using the APIs of that release pretty much the day after Apple starts prompting people in iTunes that the release is available. Easy peasy….
User Interface and Tools
iOS development has one unified toolset. XCode and Interface Builder. From my knowledge I have never looked at a Java user interface, be it Swing (yes, I know that Android doesn’t use Swing), JSP or whatever UI toolkit you use, and been flabbergasted by the experience. On the other hand, I am always amazed at the user interfaces in the Apple world. The tools, in conjunction with Apple user’s natural penchant for user experience, make this happen. Aesthetics are important to Apple users.
Java Developers are for the most part, well, developers…not user interface design experts, which is why most Java Server applications now have an Ajax framework on the front end. I do prefer the setup of doing Java Development in Eclipse (the IDE of choice for Android apps) and its customizations though. If somehow I could get tabs for my files in XCode, I would be ecstatic. I also like the code insight in Eclipse better than XCode. I also can appreciate that I can run Eclipse on any platform and XCode only runs on a Mac, but I am always on a Mac anyway, so I don’t care. I do also like that Google has made the Android development tools for Eclipse free and that it doesn’t cost much to get a Android app distributed. On the other hand, it makes it a little too easy for some idiots to write 4000 fart apps and get them into the Google App store.
Marketing and Control
While most folks harp about the nazi-like control that Apple has over the app store, I contend that this is one of the best reasons to develop for iOS. There are quite a few hoops to go through to get an app into the app store. I submitted an app yesterday, I should know. You have to have a Mac, you have to be a registered Apple Developer, you have to pay $99 a year just to be able to run your app on your device for development, you need to know Objective-C, and to top it all off, Apple has to review your app and approve it… and they are really picky.
This makes a good recipe for stability. Hey, if iOS development were easy, then everyone would be throwing up a Flashlight screen for a Flashlight, turning on the LED light or clicking to fart and putting it in the app store.
Pornography is also another problem. I like Apple control because I do not want pornography polluting my ecosystem. Pornography is what drives a large portion of the Internet, but it is also what ruins the Internet. Pornography belongs in a drawer marked “XXX, here when you want it, provided you can reach the drawer”. I am against censorship for the most part, but I agreed with having a .xxx domain to get pornography into a space that could more easily be managed. As a side note, Pornography having its own domain constitutes censorship about as much as putting government sites in .gov and TV sites in .tv. (Getting off soap box now)
Apple may get 30% of your profit for your app, but think of it this way… What is it going to cost you to have a Web site to host your app, market it and make it visible by thousands of people on the net. I’ll grant you, it will cost you a lot more than 30% of your profit. You can develop your app, submit it and once it is released, you can relax because the App store will promote it for you, it handles your upgrades, DRM and all those nasty little details you would have to do yourself. It is well worth it.
I will draw a better picture here by using two popular social media outlets. Android is open much, you have a lot of freedom…much like MySpace. iOS is closed and Apple exerts a great amount of control over the user experience…much like Facebook. Now, I know that I am making a sideways comparison, but the principles are close, but which one has been the greater success of the two social networks?
UPDATE: A day after the original article was written Google pulled an app from the app store for violating its terms and conditions, but didn’t specify what exactly the offense was. So, afterall, there are some limitations even with Google.
Malware, viruses and Spam apps
There has already been an emergence of malware problems on Android. The good thing about Android and iOS is that they have unix-based subsystems, which naturally are immune to 80% of the virus writing idiots out there, so that limits it somewhat. Android though, by its open nature, and being that developers can understand a great deal more about the source code, is more susceptible to malware. All the big name companies like McAfee,Norton,TrendMicro, etc have jumped on the bandwagon to provide protection for Android devices. Another great advantage of iOS apps is that they are sandboxed and run in a closed ecosystem with limited access to the host system. Also, since Apple guards the source code for iOS like a pit bull with a steak, developers are less likely to find holes in the OS to exploit. There are good and bad things about being open and unfortunately, the open nature of Android makes it attractive to the bad guys and the more people who get onto Android, the worse it will become. Malware writers like to attack where they can do the greatest amount of damage or collect the largest amounts of data and they like to be anonymous. The Apple app store prevents this by layers of identification and walls to hurdle. The Google App store has no such barriers.
Wrap up
I’ve covered a lot of high points here. I could write a book on the details of each of the sections above. I’d like to hear other thoughts from folks out there who have experience in both iOS and Java development and see what they think. I DO NOT, I repeat, DO NOT want to hear opinions from folks who have not coded in both or have bias against Mac or Java just for the sake of getting their opinion heard. I had a bias toward Java before ever getting an iPhone, I said I would never learn Objective-C or code in XCode, but I was dead wrong… If I can admit I was wrong, the rest of you out there can put together coherent comments instead of opinions when you comment.
I do anticipate doing development for Android at some point though, which is why I have been doing example apps on my Mac. I talk to colleagues who are writing Android apps as well to get their input. I have the SDK and Eclipse installed on my Mac. I will wait until a company buy me an Android phone before I will test on the device. I won’t commit to Android development until the demand is there and right now I see little demand, especially with iPhone hitting Verizon and eventually other carriers, but I it would not be beneath me to write an Android app if the opportunity presents itself and you better believe, I would blog about the experience.
What do you think??