BT

PhoneGap Brings Cross Platform Development Back to Mobile Platforms

by Werner Schuster on Feb 22, 2010 |

Cross platform mobile applications are a major pain today due to the mix of languages, OSes and APIs available. There are Objective-C and Cocoa on the iPhone, Android Java and native code with Android NDK on Android, JME on BlackBerry, HTML5 on Palm's webOS, C++ and other options on Symbian, etc. Sharing even basic, non-GUI code across all the platforms is impossible or impractical (Java on the iPhone? C on Blackberry? Objective-C on webOS?).

PhoneGap allows to write cross platform mobile applications. How? By using the only platform that's, more or less, consistently available on all modern smartphones: HTML5 and Javascript.

But PhoneGap applications are not web applications - they usually get packaged into applications that can be installed locally on the device and can be shipped through app stores.

Another advantage of using PhoneGap over using a web application delivered over the net: PhoneGap exposeѕ an API that gives access to features such as the accelerometer, the camera, GPS, PIMs, sound and more.
PhoneGap achieves this by using the HTML component available on the platforms (most of the time it's WebKit). Platform specific code is used to access the smartphone features which are then made available to Javascript code. The logic in PhoneGap applications is written in Javascript which can make use of the rich PhoneGap API - across all smartphone platforms (the PhoneGap wiki has a table listing feature support across smartphone platforms).

In short: PhoneGap builds on HTML5 and Javascript, adds in the platform specific features missing from HTML5 using Javascript (and platform specific native code) and allows the resulting apps to be installed natively on clients - using the appropiate platform specific method of deployment, eg. app stores.

InfoQ talked to Brian LeRoux, one of the creators of PhoneGap, about the current status of PhoneGap. Brian works for Nitobi, the company that employs a few other developers working on PhoneGap.

InfoQ: How's the support for mobile platforms coming along?

Its amazing really: we now support iPhone, Android, Blackberry, Symbian and Palm. We have some fledging support for Windows Mobile 6/6.5 and we're waiting to see what the Windows 7 Phone SDK will let us do. Apparently it will be released at Mixx so we'll have to wait and see for that platform.

Note: the PhoneGap web site has table listing PhoneGap platform support.

InfoQ: Have you had help from platform vendors with porting PhoneGap?

Sony Ericsson, Palm and Nokia have been super supportive of the PhoneGap project giving us access to their developers and resources has been invaluable to maturing the platform.

InfoQ: You recently got confirmation from Apple that PhoneGap is permitted in the AppStore.

Yes! PhoneGap only utilizes public APIs as per the SDK licensing terms.

InfoQ: Are there any things that PhoneGap developers targeting the iPhone need to watch out for?

Make sure your offline experience is just as good as when the network is connected. This is the first thing app store reviewers check. This is all super easy with PhoneGap because all PhoneGap applications are intrinsically offline anyhow. You can always check for the availability of the network using our Reachability API for things like data transport.

InfoQ: What's currently the best PhoneGap solution for Symbian? WRT or the QT versions of PhoneGap?

Right now: WRT. Six months from now: Qt. Maybe sooner. We are really excited for the Qt stuff. The browser is incredible.

InfoQ: What's the state of HTML5 & Javascript on Symbian and Blackberry in your experience?

I would say the best way to charactize HTML5 on Symbian and Blackberry is "coming soon". LOL. We know that RIM is going to send a WebKit flavored browser over the air sometime in the next quarter; they were showing it off at Mobile World Congress. Symbian will be shipping QtWebKit 4 at some point in roughly the same timeframe which will bring it up to par too.

InfoQ: Is there a way to integrate native libraries with PhoneGap Javascript applications if native code is needed?

Each PhoneGap supported platform makes native extension trivial already but we are working a better plugin architecture which we hope to release sometime this year for just this use case. Each platform has a README which helps describe this process.

InfoQ: Have there been developments in standards for accessing devices?

The standards work by DAP (Device API Working Group) and BONDI have been a great roadmap for PhoneGap. We plan to continue providing an implementation for these efforts as they progress.

InfoQ: You've recently changed the way contributors can help with PhoneGap; What was the reason for that?

We are in the process of contributing PhoneGap itself to a foundation and this requires us to have CLA (Contributor License Agreements) in place. PhoneGap will remain MIT licensed and open.

InfoQ: What are your plans for the future of PhoneGap?

More stability and more APIs all the time. The platform has grown quite mature in the past year and we're really focusing on quality right now: tests, documentation and tooling.

The best way to get started with PhoneGap is the PhoneGap website and Wiki. Nitobi offers PhoneGap training in different cities and online.

InfoQ also has a video interview with PhoneGap developers Brian LeRoux and Robert Ellis where they go into depth on the technical details and other aspects of PhoneGap. There is also a PhoneGap talk Brian LeRoux gave at last year's JSconf.

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Mokabyte Mobile use PhoneGap by mirco casoni

GruppoImola has developed a simple application using PhoneGap.
The application is only a POC but we have deployed it on the iPhone store and Android store without problems.
For us PhoneGap is a good way to approach the mobile application for enterprise.
(for a simple view of the POC www.androlib.com/android.application.it-mokabyt...)

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

1 Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT