PhoneGap and Widgets

Its been a busy month for PhoneGap, what with being acquired by Adobe and submitting their code to the Apache Incubator.

For those who don’t know already, PhoneGap provides a way for developers of mobile web applications to convert their code into apps for different mobile platforms. Effectively this means “wrapping” the web app in some sort of native shell for iPhone, Android and so on.

This provides a handy service to developers who want to focus on using web technologies (HTML, JavaScript, CSS) but want to be able to have their apps available in things like the App Store for iPhone or the Android Market without having to recode everything in Objective C or Java.

PhoneGap also provides shims for accessing common device capabilities (such as location or the camera) from JavaScript – rather like WAC or W3C DAP – whether or not the phone has actually implemented these specifications.

Perhaps a little less well known is that PhoneGap uses the W3C Widgets specification as the “lingua franca” of mobile web applications. In particular, PhoneGap uses the W3C Widgets: Packaging and Configuration specification for both the widget metadata and to configure the APIs to use.

For the latter, PhoneGap uses the W3C Widgets <feature> element for declaring which APIs the application wants available, e.g.:

<feature name="http://api.phonegap.com/1.0/battery"/>

Developers can also specify this information via a web form when uploading their widget, or include it in a config.xml file as per usual.

PhoneGap also adds a few extensions to the W3C specification, such as an <app:splash> element for defining a splash screen to display when the app launches on the phone, an orientation preference, a “versioncode” attribute (only used for Android), and a hover option for icons (only used for Blackberry).

Its interesting just how few extensions (and abuses, as Filip Maj has rather modestly described them) are actually needed in practice to target such a wide range of devices.

For more information on how PhoneGap implements W3C Widgets, check out the developer documentation for PhoneGap Build.

About these ads
This entry was posted in apps, mobile, standards, widgets. Bookmark the permalink.

2 Responses to PhoneGap and Widgets

  1. Pingback: WidgetGap: a Wookie & Cordova (PhoneGap) mashup widget | jasha.eu

  2. Pingback: Amith's Blog » PhoneGap resources

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s