Preview: Google's tantalizing Mobile Chrome App SDK
Google Chrome meets Apache Cordova
PhoneGap started life as a quick hack at an iPhoneDevCamp event and eventually grew into a widely adopted open source project targeting multiple mobile platforms, under the auspices of Nitobi Inc. By 2009, PhoneGap apps ran on iPhone, Android, and BlackBerry. Adobe bought Nitobi in 2011 and contributed the PhoneGap code to the Apache Software Foundation to start a new project, Apache Cordova. Adobe PhoneGap is now a superset of Apache Cordova, in much the same way as Apple Safari and Google Chrome are supersets of WebKit.
It took me about two hours to install the Mobile Chrome Apps development kit and all its requirements on my iMac. I already had most of the major pieces installed, such as Node.js, the Android SDK, and Xcode, although I needed to do some updates and add Java and Ant to the Bash path. If you're starting from scratch, it may take you longer. If you already have all the prerequisites up to date, you may be up and running in less than an hour. If you're working on a Windows machine, you won't be able to build iOS apps, but you will be able to build Android and Chrome apps.
In addition to providing the application shell, Mobile Chrome Apps gives you access to many of the Chrome and Cordova APIs. The Chrome APIs include:
identity-- use OAuth2 access tokens to sign-in users without prompting for passwords
payments-- sell virtual goods within your mobile app
pushMessaging-- push messages to your app from your server
sockets-- send and receive data over the network using TCP and UDP
notifications(currently Android only) -- send rich notifications from your mobile app
storage-- store and retrieve key-value data locally
syncFileSystem-- store and synchronize files on Google Drive
alarms-- run tasks periodically or at a specified time in the future
The application shell gives a hybrid app retained state that isn't available to a mobile Web app. You can see the difference dramatically on your phone or tablet when you switch to a different app and then back. The hybrid app comes back the way you left it; the Web app doesn't.
Figure 1: At the left, we see the source code for the "Hello, InfoWorld" Mobile Chrome App in the Eclipse-based Android Development Tools; at the right, we see it running in an Android emulator. A single project supports a Chrome Web app, an Android app, and an iOS app.