Chapter 13. Other Native Platforms

If you want to build applications for the iPhone and the iPod touch that will be sold on the App Store, alternatives are available to the traditional Objective-C and Cocoa Touch route. Development platforms now exist allowing JavaScript and C# developers to get direct access to the iPhone’s hardware features, such as the accelerometer.


PhoneGap, developed by Nitobi, is an open source development platform for building cross-platform mobile applications with JavaScript.

On the iPhone, it works by providing a prebuilt library containing Objective-C classes that wrap the iPhone’s native capabilities (e.g., vibration and accelerometer support) and exposes these capabilities to JavaScript along with an Xcode project template that makes use of the library. You can then compile your application as a hybrid of native Objective-C and JavaScript inside Xcode.

The platform is device-agnostic, allowing you to build an application for the iPhone, Android, and BlackBerry devices simultaneously. Developing applications using the PhoneGap framework is a reasonable alternative to building all-native applications in Objective-C.

In the past, submitting to the App Store applications built around the PhoneGap platform was problematic. However, since the 0.8.0 release, this has been resolved and Apple has approved PhoneGap for building applications intended for the store.


Since the 0.8.0 release, the PhoneGap platform has embedded a version tag into the compiled ...

Get Learning iPhone Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.