W3C home > Mailing lists > Public > www-tag@w3.org > February 2010

ACTION-345: Investigate possible convergence of phonegap and w3C widgets

From: <noah_mendelsohn@us.ibm.com>
Date: Wed, 3 Feb 2010 22:22:11 -0500
To: www-tag@w3.org
Cc: Robin Berjon <robin@berjon.com>, Dan Brickley <danbri@danbri.org>
Message-ID: <OF4002AC15.57B7F3E8-ON852576C0.000F97D3-852576C0.001283A7@lotus.com>
Some time ago I took ACTION-345 [1]: investigate possible convergence of 
Phonegap [2] with and W3C Widgets [3].  This note is intended to fulfill 
that reaction.  It is based in part on the helpful responses of Robin 
Berjon [4] and Dan Brickley [5], as well as my own investigations.

What are W3C Widgets

I'm assuming that in this community, most readers are familiar with the 
W3C Widgets effort.  Briefly, Widgets will be a set of W3C specifications 
providing for the ability to create standardized, cross-platform 
installable application packages.  The apps themselves are coded in HTML, 
CSS, Javascript, etc., and per the W3C Widget Packaging and Configuration 
Specification (now in Candidate Recommendation) [3] these pieces are 
packaged in a standard zip-encoded file, with a manifest, for 
distribution.

Note that widgets can only be used if the target platform supports them. 
Using iPhone as an example, there is currently no way to submit a widget 
to the iTunes store for distribution as an application, and the iPhone 
does not ship with support for installing and launching a widget.   Some 
commercial organizations (e.g. Vodafone) have announced support for 
Widgets on their devices and networks.

What is Phonegap

Phonegap [2] is an open source offering that is intended to facilitate the 
creation of mobile phone applications using HTML, CSS, Javascript, and 
other Web technologies.  Unlike W3C Widgets, Phonegap creates a platform 
native installable executable for each application.  So, although the 
application itself is written in a manner very similar to W3C Widgets, 
there is a compile/package step for each platform that results in whatever 
is the normal application packaging for that platform.  For example, for 
iPhone, Phonegap produces what appears to be an Objective-C application 
that can be distributed in the usual way through the iTunes store.  On 
Android, Phonegao creates an Android executable, and so on.  As far as I 
can tell, only Android and iPhone are supported today. 

In addition to creating separate installable packages for each Platform, 
one of the main purposes of Phonegap is to expose, through Javascript, 
device capabilities that might not normally be available to browser 
applications.  So, for example, Phonegap typically provides support for 
things like geolocation, accelerometer, access to photos, local storage, 
etc.  I believe that, to use iPhone as an example, what Phonegap does is 
to ship a more or less common Objective-C wrapper for each application: 
the wrapper launches Webkit [6] (not Safari) to render the HTML and CSS, 
but the Objective-C includes shims that implement Javascript APIs that are 
relayed to platform things to get services like geolocation.  So, these 
Phonegap APIs are very much in the same space as the W3C device APIs, and 
indeed Phonegap has often been ahead of W3C in proposing and implementing 
such APIs.

What sort of convergence can we anticipate?

Robin reports [4]:

> the DAP WG is taking input from PhoneGap into consideration, 
> and is looking at PhoneGap as a potential implementation vector
> — this is not directly related to widgets per se, but having 
> the same APIs makes using the same packaging format a whole lot
> more useful;

This is consistent with anecdotal reports I've heard.  I.e. there are 
informal efforts to have all these APIs wind up as consistent as possible, 
and perhaps even fully compatible.  I don't think there is any enforceable 
commitment to that right now, but it seems that most everyone involves 
thinks this is a good think to try for and is working toward it.

The other sort of convergence I've heard people speculate about, is using 
Phonegap or similar tools as vehicles for packaging widgets for the 
platforms on which they don't run natively.  Of course, this partially 
compromises the Widget vision, insofar as you then wind up with 
proprietary application packages after all, but it has the great value of 
allowing one to move a portable widget onto these platforms in a 
relatively mechanical way.  Dan Brickely reports on his early experiments 
doing this [5], and they look promising.

I do not intend to make further investigations of Widget/Phonegap 
convergence at this time, so I am marking ACTION-345 as pending review. My 
thanks to Dan and Robin for their very useful assistance with this action. 
 Thank you.

Noah

[1] http://www.w3.org/2001/tag/group/track/actions/345

[2] http://www.phonegap.com/

[3] http://www.w3.org/TR/widgets/

[4] http://lists.w3.org/Archives/Public/www-tag/2009Dec/0106.html

[5] http://lists.w3.org/Archives/Public/www-tag/2009Dec/0108.html

[6] http://webkit.org/


--------------------------------------
Noah Mendelsohn 
IBM Corporation
One Rogers Street
Cambridge, MA 02142
1-617-693-4036
--------------------------------------




Received on Thursday, 4 February 2010 03:22:52 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:48:19 GMT