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??
I think you made some very good points but see a lot of flaws in your comparisons and biases. At least half of the article speaks to Java and JEE, and the respected vendors and not Google and Android, while some of the arguments apply not all of them, and they should be put into the context of Android and Google for argument. Also you continue to refer to 'DROID'. DROID is not Android, it is a trademarked name for the line of Android phones that Verizon carries. Your constant misuse of this nomenclature makes me disvalue your arguments, no matter how sound, just a little more. Some good and valid points were made though
My apologies for trying to shorthand Android. The reference was to the OS and not the device and that is very clear. I have renamed for clarity though. The point that I am trying to drive is a comparison of developing in Java on any platform, since it applies to the intentions of the Java language to be platform agnostic, to Objective-C on any Apple platform. Aside from correcting my use of verbiage, you provide no valid points otherwise. I would like to hear clear points on why you disagree or agree.
Tieing java to Oracle and IBM is just shortsighted. Java consist of an imense community outside of those two. There's a lot of production ready, highly advanced and interesting software coexisting with a lot of legacy software.
People have trouble understanding this, the java platform and ecosystem is orders of magnitude bigger than Java the language. This includes Android.
Java is owned by Oracle now, just like it was owned by Sun and Oracle is not as benevolent as Sun was. Oracle has the rights and they can do with it as they please. Without the brand and the JVM, Java is nothing.
“People have trouble understanding this, the java platform and ecosystem is orders of magnitude bigger than Java the language. This includes Android. “
I'd be interested in hearing you expand on this a bit. So if you remove the Java language from the Java platform and ecosystem, what is left over?
You wrote that you chose iOS (iPhone) because you love Apple platform. This is exactly the reason why I did not write a line for iPhone. To do this I had to buy an Apple computer which I never liked, in other words I had to become Apple jailed fan boy. I did not like the idea to buy a computer just to write a small program for smart phone.
OK, you want clear points, I will try. Sorry for my english, I am italian.
Platform: if you prefer XCode over Eclipse, nothing will change your mind. I feel the opposite. XCode is just unusable, with all those windows opening and getting lost on a single-workspace desktop.
But working on Android you just ignore Unix-Windows nuisances. Android is Linux. Just use Android functions and ignore Windows.
Oracle bought Sun and Java. Dalvik does not use Java. It is a language very similar to Java, but it is not Java. Google can (it is already so) fork “java” and make a compiler on its own.
Performance: you are right, Dalvik can be slower than Obj-C. That's excatly the reason there is a NDK for Android. You can continue using an easy-to-code language for 95% of your application, and use a hard-to-code-but-very-fast language (C or C++) for that 5% resource-intensive part.
Keep in mind that a big part of Android is already compiled C code: the audio and video (en|de)coders, the font rendering engine, the network layer, the XML parsers, etc. etc. You just use Java interfaces to access them.
Fragmentation: you mean having resolution, 3g, gps, camera, second camera, multitasking, etc. differences doesn't count as fragmentation? Nearly all of apps on the App Store are 3.x compatible.
Android even lets you use a feature introduced in a new SDK release only if the software is running on that release, or degrade gracefully if it is not. You can code for 2.0 and cover over 85% of handsets.
UI: you continue bashing of Java UIs, not realizing that there is not a single line of Swing in Android. Have you really tried to develop for Android or are you just supposing it is exactly like Java?
Control: if you feel safe in your golden cage, just stay there. You have limitations (no porn, no sexy either, no alternative-to-Apple-apps app, no voip, etc.). As I said, if you like it, stay there. There is nothing I could say that could change your mind. Just getting punched in the face could, so I think you just have to wait for the punch coming.
You don't like Linux because it forces you to choose between various alternatives. If you don't like to have a choice, no wonder you like Apple. The day you will realize a choice would have been good (say: you want to make a gift, a 300$-smartphone, and you only find 700$ iPhones) maybe you will like having alternatives.
Bye.
@Alessandro Pellizzari – If you read the article or a better translation thereof, you will see that I like parts of Eclise and XCode. Eclipse does a lot of things better than XCode.
I never said Swing was involved in Android. I was referred to any type of GUI developed by Java developers.
I never said I didn't like Linux. I love Linux.
You make a valid point with porn… I like not having it on my device or the availability thereof. Porn has it's place and it isn't on my phone. If you want porn, you better create another OS that will allow it. I am doubtful that Google will allow porn to run rampant on Android apps.
If I want alternative to Apple apps, I will start creating Android apps.
A subsidized iPhone and an Android phone are the same price at present. $299 subsidized contract for the most part. That was the same when iPhone was the only kid in town.
You missed my point with fragmentation.
I never said Android was Windows. I was just making a comparison.
You only made a couple of good points. The best one being that you have choices…
@Dov
I understand your issue if the last time you used Mac was greater than 5 years ago… I went back to Windows machines at home from Mac back in 2002, but went back to a Mac a year ago and I was surprised that everything was there now that I needed and everything just works. Macs are also expensive, but quality as well. Give one a try now…see what you think.
I'm not sure if it was intended but it did come across that you thought Swing was used in Android to me as well. Maybe just needs rewording slightly because I know what you were trying to get at.
With fragmentation you have lots of tools to deal with that. With physical phone differences you can define different sets of resources for different screen sizes, densities, orientation and so on. This is extremely simple and the app I've made can scale from a 3 inch phone to a 10 inch tablet on one set of code, only changing the resources (layouts and so on):
http://android-developers.blogspot.com/2009/10/support-for-additional-screen.html
Different versions of the SDK is harder, but still possible and fairly easy to do. It basically amounts to checking if a feature is supported and if not providing an alternative or disabling that feature. It's normally application dependant but there's a nice (if old) blog post about it on the Android developer site:
http://android-developers.blogspot.com/2009/04/backward-compatibility-for-android.html
That reminds me. I'm an Android developer and haven't done iOS development at all, however one advantage that iOS has over Android is the amount of support there is out there for developing for that platform. Android has great documentation (for the most part) however there are very few high quality third party sites providing support for developing for Android. Mobilestuts is just starting to get into I think.
Nice article, but quite a few of your points suggest you haven't made an Android apps really, I'm not sure if that's the case.
Another post about same topic.., a little Spanish company, having chosen iOS for mobile development…
http://weblog.linkingpaths.com/en/2011/01/18/why-we-chose-ios-as-development-platform/
Main reason, iphone users are used to paying for apps… it is key to small companies that cannot split their efforts…
Regards
@Matt Oakes – Excellent counter arguments.
@Alejandro – Being that there is a greater investment that has to be made to distribute iOS apps, developers are more apt to charge to recoup their investment. I'd also add that since you are charging for an app, it does have to be of higher quality.
Thanks to you both for the logical posts…
Are we likely to see any follow up to this post from you in the future?
@Matt Oakes – Yes, what I would like to do is have a part 2 in 6 months and another in 1 year, just to revisit to see how things progressed. If you write an opposing article about why you prefer Android, I would like to link to it.
I'm not sure I'm the best person to write an opposing article because I've never actually done anything with iOS at all, except for using an iPhone and an iPad briefly.
What I might do is write something elaborating on the points I made in my comment. I won't be able to write it for a while though because I'm in the middle of my exam period (stupid degree getting in the way)
I'll make sure to post a link here if I do write anything interesting. My blog is: blog.matto1990.com if you're interested.
I am currently programming on both the iPhone and the Android platforms. I prefer the Android side.
Android
Easier to find sample code / solutions for what I need. I have a feeling the developers are more open and there is no NDA from Google to follow, talk about what you want. Apple had an NDA for a long time, which has since lifted, but developing seems to be more secretive.
Even when I find a solution on the iPhone side it takes a lot more code to implement some of it being rather bizarre. Trim a string, convert a string date to an NSDate, try to get the debugger to show the values of nearly anything, change the name of your project, I could go on and on.
Objective C syntax is ugly and not easy to read. It was written so they did not have to write a new language. It is a preprocessor hack mostly for the NextStep. It is an old language and it really shows. NS precedes most objects. There is no standard support for RegEx – really in 2011 and I have to find a RegEx lib myself? I am getting more used to it but I still find it tough to read.
Xcode needs an update. There is no competition here which hurts. I hope 4.0 is a big improvement but I don't think we are getting tabs for open files which I really want. Eclipse is not prefect but has a lot of features I really like. You can also use IntelliJ 10.0 if you like. Competition is good.
The iPhone Simulator is starts up and runs quickly but it is not an emulator. You don't get a true sense of the speed your app will run on the device.
You MUST pay to put an app on your iPhone and you are limited to the number of devices you can put it on for testing. On the Android I was able to plug in my USB cable and run the program I wrote on MY phone no questions asked. I think this leads to more hackers but it also leads to more developers experimenting on the Android.
The Apple developer set up process took us a few months, many phone calls and emails with Apple to get set up. They ended up cancelling our account and starting over it go so screwed up between Connect and iOS dev.
I find I can write, debug and release code much faster on the Android. If you have a list view that is empty you set on thing in the XML on the Android to show a message or image to say “no items found” etc. On the iPhone you have to lie to the callback method that you have an item and then lie in some other code to return that item and lie over here and there. This is a STANDARD situation, an empty list. Seems since the Android SDK was written well after the iOS SDK they took a lot of things into account. I really want to see Apple move the SDK forward and be more friendly.
There is fragmentation on both sides. The Retina display on the newer iPhones is a ton better than the old display. Fonts you can use there you can not use on an older devices. You really need to code a different app for the iPad vs the iPhone, just growing it is silly. Same thing on the Android side.
I have made minor tweaks to my code on the Android platform to handle different DPI and screen sizes. So far it has not been that big of deal for me.
On the UI side Apple is not perfect. Keyboard only has UPPERCASE characters. You have to switch modes to get to pretty much any other character while on the Android you get upper and lower case based on shift key along with long holding a key to get a number or symbol.
iPhone date selector you have to spin the wheel, Android you can long hold on a date and it allows you to type the number.
iPhone take up top part of screen to show a “go back” button while Android has buttons for back, menu, etc. Reminds me of Apple and the single button mouse ONLY even though the world had moved on to multiple button mice.
Check out my blog for other things I have found during my venture into both platforms by clicking on my name for this comment.
Very good comment Kevin. I'll take a look at your blog
Hello.
This is a very nice post!
The Kevin's comment is the best just now. Technically simple for the comparision.
I'am a java developer too and i wanna go towards the smart phone mobile development.
Greetings from Ecuador
I’m looking for a career change – have been in the design and architecture industry for a long time and developing apps is something i have been thinking about for a while. I’m pretty good at graphics and design as well. Based on your article it seems like learning Objective C would make more sense…