PhoneGap: It’s Like AIR for the IPhone 
September 18th, 2008
A few weeks back Brock and Rob from here at Nitobi built an amazing IPhone framework down at IPhoneDevCamp that we have named PhoneGap. While I have attributed the injustice of us not winning any of the competition categories of IPhoneDevCamp to the completely jaw dropping achievement of our team, in just two days of development (with most of the competition winners having developed their apps weeks or months before IPhoneDevCamp) it does not take away from the excitement I have for our PhoneGap framework. And there is lots of excitement around PhoneGap with some blogs about it, lots of activity over at GitHub, and 60 people signed up to the PhoneGap Google Group in just a few short weeks!
While some may not have realized the impact of PhoneGap (including the judges at IPhoneDevCamp), we here at Nitobi think that PhoneGap is the Adobe AIR of the IPhone (not to mention Blackberry, Android, Symbian and Windows Mobile). Just like Adobe AIR enables web developers to build Windows and OS X applications using the HTML and CSS skills that they know and love, PhoneGap allows web developers to build applications for the IPhone with web technologies while taking advantage of the native IPhone APIs like GPS, the camera, SQLite, contacts and more!
Using PhoneGap, a developer need not write any Objective-C code and yet they can still have a proper app installed on an IPhone that is essentially a slightly customized PhoneGap application that sports a custom icon and a certain URL where application lives online (very much like AIR). When a user starts PhoneGap it essentially creates a headless (ie no address bar) browser on the IPhone and navigates to the specified URL where the author of the web page can access IPhone APIs through JavaScript like this:
getLocation();
//GAP will invoke this function once it has the location
function gotLocation(lat,lon){
$('lat').innerHTML = "latitude: " + lat;
$('lon').innerHTML = "longitude: " + lon;
}
Or access the accelerometer data like this:
function updateAccel(){
$('accel').innerHTML = "accel:"+accelX + " "+accelY+" "+accelZ;
setTimeout(updateAccel,100);
}
Someone has even tried to get a PhoneGap on the App Store - however, has had little success so far.
The aim of PhoneGap is to bring mobile phone development to web developers just as AIR has brought desktop application development to the web community. One of the next steps will be packaging _all_ the HTML, JavaScript and CSS into the application that goes on the IPhone so that the application can even run offline much like AIR does.
There is still lots to be done!
Image by http://flickr.com/photos/nielsvaneck
Del.icio.us
This entry was posted on Thursday, September 18th, 2008 at 12:57 pm and is filed under Web, Web2.0, adobeair, mobile. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

September 20th, 2008 at 8:37 am
[...] out the full article here, or stop by the PhoneGap website and grab the source. Submit this page to other blogs: These [...]
September 22nd, 2008 at 7:31 am
[...] Dave Johnson calls PhoneGap “AIR for the iPhone” because this nice little hack, first created at an iPhone BarCamp, wraps the Web view with a container. This container gives the view access to APIs available on the device, that may not be available yet via WebKit alone. AIR provides a similar container for Flash and Ajax content on the desktop. PhoneGap is a free open source development tool and framework that allows web developers to take advantage of the powerful features in the iPhone SDK from HTML and JavaScript. We’re trying to make iPhone app development easy and open. For many applications a web application is the way to but in Safari you don’t get access to the native iPhone APIs, and the that’s the problem we’re trying to solve. [...]
September 22nd, 2008 at 2:13 pm
[...] developer Dave Johnson compares PhoneGap to Adobe AIR, though there’s still a lot of work to be done to package it all up. The comparison is sound, [...]
September 22nd, 2008 at 4:52 pm
[...] developer Dave Johnson compares PhoneGap to Adobe AI…, though there’s still a lot of work [...]
September 23rd, 2008 at 5:11 am
[...] Full Article [...]
October 11th, 2008 at 3:37 pm
[...] developer Dave Johnson compares PhoneGap to Adobe AIR, though there’s still a lot of work to be [...]
October 17th, 2008 at 4:46 pm
[...] Recently, I’ve been looking at PhoneGap. However, unlike most people at Nitobi, I am using a PC. However, I spend most of my time running Ubuntu Hardy Heron on my dual-boot system. This means that unless I wanted to jailbreak a phone, there’s really no way that I could do iPhone Development. However, the other day I decided to start taking a look at the Android SDK when the G1 was announced. It’ll be a while since we’ll get any Android phones in Canada (for more info, read this), it’ll be good for the rest of the planet to have the ability to write once and run anywhere. Sort of like what Dave said. [...]