What is the point of Java on the iPhone?

March 12, 2008

java_iphone-thumb.gifI love Java. A large part of my success as a software developer over the last decade is due to the fact that I was an early Java adopter. Java also allowed me to grow professionally and become a Software IT Architect at IBM. Over the years I have written many J2EE web apps, some J2SE applications and even one Java2ME program for a Sony-Ericsson handset. The fact is that I am totally convinced by the many benefits of Java and I do not feel attracted by any other language to write enterprise web applications. But seriously, Java for the iPhone? Why?

On the server, J2EE is extremely appealing because it is an open, scalable, secure technology that allows developers to create complex solutions. If you plan to integrate all kind of legacy systems or develop true robust distributed systems Java simply has no competition.

On the desktop, the situation is quite different. Sun Microsystems tried to create a platform that would allow developers to create applications that would work on any OS. Their first attempt at providing a common GUI was the AWT. It was a complete failure because it only allowed to use controls common to all existing platforms. Complex controls such as trees or tables could not be used because even if they existed on Windows or the Mac, they were not available on other OSes such as QNX. The second attempt, an API usually known as Swing (or JFC) tried to solve the problem by avoiding native widgets altogether. Instead, each component was drawn in Java, bypassing the OS. This move allowed Sun to support complex controls on any OS. However, the first release of Swing was painfully slow and a memory hog. As a result, most developers have avoided the technology despite Sun’s efforts to improve it in subsequent releases. The problem is that every time the Look and Feel of an OS is updated, Swing needs to be updated also, to ensure that widgets are drawn properly. IBM proposed a better solution, called SWT, used in Eclipse and many other Java applications. Instead of hand drawing all controls, SWT uses native controls when available and draws them manually as a last resort. The result is a more efficient API that produces much better results. Even so, users normally can quickly spot Java desktop apps because they simply do not look native. This is specially true on the Mac. While PC users seem to have no problem at all using Java applications such as Azureus, Mac users seem to prefer non Java alternatives such as XTorrent or Transmission. To make a long story short, those who designed the Java strategy for fat clients assumed that all GUI were similar and that any differences were merely cosmetic. It was a terrible assumption that was made well before Apple migrated from OS 9 to OS X (which makes heavy use of transparency and animations) by people who could not envision how technologies such as hardware accelerated graphics would impact GUIs. The result is that very few still consider Java as a viable option for creating desktop applications.

On a phone, the situation is even worse. Developers don’t really know what to expect from a Java capable phone. There isn’t much standardization and capabilities vary significantly from one phone to another. The main benefit of Java2ME on a cell phone is that it makes migrating applications from one cell phone to another relatively easy. This is specially true for mobile games that do not require a standard user interface and where all the display is handled by Open GL.

The iPhone is a device that lies somewhere between a computer and a phone. It has an amazing user interface that users expect applications to fully embrace. Java currently does not offer any solutions to work effectively with that aspect of the device. However, Java could still prove useful to help quickly migrate all those games written for other handsets to the iPhone. Is this important for Apple and iPhone customers? I doubt it. With over 100,000 SDKs downloaded in just over four days, it seems that the iPhone will not lack native software (including games). The announcement made by Sun that it plans to make Java available for the iPhone is mainly targeted at existing J2ME developers. The company run by Jonathan Schwartz wants to open a new market for their software development partners to prove the value of J2ME by making it easy to sell old content on a new platform.

Until now, only large companies could negotiate with telcos to get their content on the carrier’s phones. The margins were razor thin and to make any money you needed to get your content on millions of phones. Supporting multiple brands of handsets was a necessity and in that context, Java was a blessing. The announced App Store is leveling the playing field. Now everyone can sell mobile apps. With 70% of the price of the software going straight to the developer, it makes sense to develop applications specifically for the iPhone.

On March 6th, Apple invited mostly large companies to show the software they were working on at the iPhone software roadmap event. However, you will see that by late June, when Apple releases version 2.0 of the iPhone firmware, most of the applications available through the App Store will come from passionate independent developers that will try to get out the most out of the device, not companies trying to obtain incremental revenue from something written years ago. In fact I predict that many large companies specialized in developing software for mobile phones will find it difficult, at least at the beginning, to compete against many of the enthusiasts who will create innovative solutions at home during their spare time.

I abandoned Java on the desktop for Objective-C years ago because Cocoa allowed me to get the most out of the Macintosh platform. The same applies to the iPhone. Objective-C is similar to Java in many ways. What makes the difference is Cocoa touch which is a great development framework and allows to get to the guts of the iPhone without compromises. That is why I personally don’t care if Sun releases a Java SDK for the iPhone or not. I am quite sure most of those 100,000 developers who have downloaded the SDK agree with me.

© 2026 Huibert Aalbers. All rights reserved.

Contact Me