PhoneGap – Cross platform mobile development

May 21st, 2009 by mike Comments (2)

BJ sent me a link to PhoneGap yesterday and asked me to take a peek at it, here are my two cents on it.

PhoneGap as a whole is extremely impressive, but it’s probably more ambitious than functional at this point. The main selling point for the platform is that there is practically no barrier to entry for web developers. You develop applications on it using css, html and javascript, which is going to be a welcome alternative to objective-c / Java for most of us. Another immediate advantage to this is that it makes creating a seamless experience between a website and an iPhone app pretty easy, you can just copy the css from your website to keep the same look and feel. PhoneGap extends portions of the APIs for Android, iPhone and Blackberry devices and abstracts them into a javascript framework, the key here is that it abstracts them all into the same javascript framework, so your code will run on all three devices in more or less the same fashion.

All of this needs to be taken with a grain of salt though, there is still a lot of functionality you lose out on, the PhoneGap wiki has a nice chart that lets you see what you can accomplish so far. Needless to say, the lack of support for features like the camera or the local filesystem is a little disappointing. The other main gripe I have with the platform is that it kills the efficiency of your applications, I made up a little chart to give an idea of what is going on when you create a PhoneGap app, we’ll focus on the iPhone since it’s the best supported platform so far:

Basic structure of a PhoneGap application on the iPhone

Basic structure of a PhoneGap application on the iPhone

Normally when you write an iPhone application, your code executes directly on top of a “sandbox” area that is kind of like a sequestered portion of the operating system which the iPhone gives limited access to. It’s not a terribly efficient process to begin with, but it gets the job done. For PhoneGap applications, they run their framework in that sandbox, which in turn runs safari, and then safari’s javascript interpreter (webkit) which itself is a virtual platform, executes your code. The entire process decreases the efficiency of your application by quite a bit. Aside from efficiency, there is other baggage that comes with writing your applications on top of a javascript interpreter: you’re at its mercy. If at some point in the future there is an update to webkit which doesn’t jive with the code you have written, your entire application is hosed and you’ll need to release an update for it.

In any case, despite its shortcomings, PhoneGap is a promising platform for simple iPhone applications, the project is well documented due to an active and knowledgeable community, and that’s a good sign of it maturing as time goes on.



2 Responses to “PhoneGap – Cross platform mobile development”

  1. Michael Nachbaur

    Good write-up, though I would point out that the phonegap.com website has languished over the past few months, as most development has been centered around the development version in Git. It really has progressed in leaps and bounds, though what you see on the phonegap.com site is unfortunately what most people see when they first come to the project.

    So if you want to take a look, peek in Github at http://github.com/phonegap/phonegap, or at my personal branch at http://github.com/NachoMan/phonegap

  2. mike

    Thanks Mike, I’m glad you found us. I did a clone of the latest development version, I’ll peek through it and update the post to reflect what I find.

Post a Comment