8/03/2008

Porting applications to the iPhone OS 2.0

Lately I have been porting a considerably complex application using the iPhone OS 2.0 SDK. In the past, I have been developing mobile applications for WinCE, PocketPC, and Symbian. With regards to WinCE/PPC, I believe that Visual Studio is a great IDE, but a great IDE is not always the most important factor when developing mobile software. Speaking of Symbian OS (S60 platform), the most popular IDE is Carbide, built upon the Eclipse IDE platform, which I'm not really a big fan of. One very good thing about S60 is the OpenC library, an extensive collection of POSIX and other well-known C libraries, which makes it easier to port for this platform. However, in my personal experience, the development for the Symbian OS (mainly porting) was kind of traumatising when combining the IDE with the platform and the mobile hardware. First, the emulator is bad, slow and works horribly when comparing to the same application deployed in a mobile phone. Secondly, although you can do it graphically after pressing a thousand menus and buttons, you have to write a makefile-like with a lot of tricks/hacks, in order for the compilation to be successful.

Although Xcode is still not as good as Visual Studio, it is far much better in the sense that it seamlessly integrates with the iPhone Simulator, deploying and running applications in a fast and efficient manner. In terms of porting existing code to the iPhone OS 2.0, it was not very painful, mainly because there is not much of a difference between developing for the iPhone and for the MacOS X.

Summarising what I think about the 3 platforms:


  • WinCE/Pocket PC: Great IDE / Very specific platform. Threading and memory maps work horribly / Emulator? Does it even work? / Deployment (slow slow slow)... "90% del tiempo perdido en tonterĂ­as"

  • Symbian OS (S60): Complicated IDE / OpenC is a plus / Emulator? Does not work properly and it is very slow / Deployment could be more straightforward

  • iPhone OS 2.0 SDK: Not as full-featured as VStudio but still does a great integration with debugging and deployment / UNIX-like development, UIKit/FoundationKit and Objective-C++ are a big plus! / Fast deployment, debugging and simulation (emulation)!



The most important factor about iPhone OS 2.0 platform that makes it superb for development is that it supports Objective-C++, making it very easy to port existing UNIX applications since you can mix Objective-C with C/C++ code just by renaming the files to ".mm" (instead of Objective-C's ".m" extension).