Standards for Web Applications on Mobile: February 2011 current state and roadmap

Latest version
http://www.w3.org/Mobile/mobile-web-app-state/
This version
http://www.w3.org/2011/02/mobile-web-app-state
Previous version
N/A

Web technologies have become powerful enough that they are used to build full-featured applications; this has been true for many years in the desktop and laptop computer realm, but is increasingly so on mobile devices as well.

This document summarizes the various technologies developed in W3C that increases the power of Web applications, and how they apply more specifically to the mobile context, as of February 2011.

This document is the first version of this overview of mobile Web applications technologies, and represents a best-effort of his author; the data in this report have not received wide-review and should be used with caution. Feedback on every aspect of this document should be sent to the author (dom@w3.org) and will serve as input for the next iteration of the document.

The features that these technologies add to the Web platform are organized under the following categories:

Diagram showing the various components of the Web platform
The Web as an application development platform

In each category, a table summarizes for each feature:

As a reminder, W3C creates Web standards by progressing documents through its Recommendation track, with the following stages:

Prior to starting this standardization, a Working Group needs to be chartered, based on input from W3C Members, often through the organization of a workshop, after the reception of a W3C Member Submission, or as a follow-up to the work of a W3C Incubator Group.

Graphics

SVG, Scalable Vector Graphics, provides an XML-based markup language to describe two-dimensions vectorial graphics. Since these graphics are described as a set of geometric shapes, they can be zoomed at the user request, which makes them well-suited to create graphics on mobile devices where screen space is limited. They can also be easily animated, enabling the creation of very advanced and slick user interfaces.

The integration of SVG in HTML5 opens up new possibilities, for instance applying advanced graphic filters (through SVG filters) to multimedia content, including videos.

In complement to the declarative approach provided by SVG, the <canvas> element added in HTML5 enables a 2D programmatic API that is well-suited for processing graphics in a less memory intensive way. That API not only allows to render graphics, but can also serve as a way to make image processing and analysis.

Both SVG and HTML can be styled using CSS (Cascading Style Sheets); in particular, CSS3 (the third level of the specification) is built as a collection of specifications set to offer a large number of new features that make it simple to create graphical effects, such as rounded corners, complex background images, shadow effects (CSS Backgrounds and Borders), rotated content (CSS 2D Transforms), animations (CSS Animations, CSS Transitions), and even 3D effects (CSS 3D Transforms).

The cascading model of CSS is completed with the possibility of customizing the applied rules to the characteristics of the device through CSS Media Queries, a mechanism particularly useful on mobile devices to cater for the variation among screen sizes.

Fonts play also an important role in building appealing graphical interfaces, but mobile devices are in general distributed with only a limited set of fonts. WOFF (Web Open Font Format) addresses that limitation by making it easy to use fonts that are automatically downloaded through style sheets, while keeping the size of the downloaded fonts limited to what is actually needed to render the interface.

NB: work on defining a 3D graphic API called WebGL has started outside of W3C, as part of the Khronos Group; this API has been built to be compatible with OpenGL ES, i.e. for embedded systems, and is intended to work on mobile devices.

FeatureSpecificationWorking GroupMaturityStabilityLatest editors draftCurrent implementationsTest suite
2D Vector GraphicsSVG Tiny 1.2SVG Working GroupStandardFinishedNew version of SVG (SVG 2.0) in preparationWidely deployed (iOS, BlackBerry, WebKit on Nokia, webOS, Opera, Firefox, announced for Android, announced for Windows Phone)High coverage
2D Programmatic APIHTML Canvas 2D ContextHTML Working GroupWorking DraftMostly stableUpdated regularlyWidely deployed (iOS, BlackBerry, Android, webOS, Opera, Firefox, announced for Windows Phone)Good coverage
Rounded CornersCSS Backgrounds and BordersCSS Working GroupCandidate RecommendationMostly finishedUpdated regularlyDeployed as an extension in many mobile browsersNone
Complex background imagesLimited (?)
Box shadow effectsLimited (?)
CSS 2D TransformsCSS 2D Transforms Module Level 3Working DraftStabilizingLast update May 2010Limited (?)None
AnimationsCSS Animations Module Level 3Working DraftFirst draftUpdated regularlyLimited (?)None
CSS Transitions Module Level 3Working DraftEarly draftLast update Aug 2010Limited (?)None
3D EffectsCSS 3D Transforms Module Level 3Working DraftFirst draftLast update Dec 2010Very limitedNone
CSS-based AdaptationMedia QueriesCandidate RecommendationMostly finishedLast update Aug 2010Widely deployedGood coverage
Downloadable fontsWOFF File Format 1.0WebFonts Working GroupLast CallStabilizingLast update Nov 2010Growing deploymentGood coverage

Multimedia

HTML5 adds two tags that improves dramatically the integration of multimedia content on the Web: the <video> and <audio> tags. These tags allows to embed respectively video and audio content, and make it possible for Web developers to interact much more freely with that content than they would through plug-ins. They make multimedia content first-class citizens of the Web, the same way images have been for the past 15 years.

While these tags allow to play multimedia content, the HTML Media Capture and the Media Capture API define mechanisms to capture and record multimedia content using attached camera and microphones, a very common feature on mobile devices.

Beyond recording, two additional APIs add multimedia manipulation capabilities to the Web platform. We have already mentioned the Canvas 2D Context API: it enables modifying images, which in turn opens up the possibility of video editing. In a similar vein, a W3C Incubator Group has been working on an Audio API (Mozilla’s proposal draft) that makes it possible to modify audio content, as well as analyze and synthesize sounds — this work is now under consideration to be moved under proper standardization.

The combination of all these features mark the starting point of the Web as a comprehensive platform for multimedia, both for consuming and producing. The rising interest around bridging the Web and TV worlds (manifested through the W3C Web and TV Interest Group) should strengthen that trend in the coming months.

FeatureSpecificationWorking GroupMaturityStabilityLatest editors draftCurrent implementationsTest suite
Video playingHTML5 video elementHTML Working GroupWorking DraftStabilizingUpdated regularlyGrowing deploymentJust started
Audio playingHTML5 audio elementBarely started
Capturing audio/videoHTML Media CaptureDevice APIs & Policy Working GroupWorking DraftEarly draftLast update Nov 2010Very limitedNone
The Media Capture APIWorking DraftEarly DraftLast update Dec 2010None (?)None
Image & Video analysis, modificationHTML Canvas 2D ContextHTML Working GroupWorking DraftMostly stableUpdated regularlyWidely deployed (iOS, BlackBerry, Android, webOS, Opera, Firefox, announced for Windows Phone)Good coverage
Audio analysis, modificationNoneAudio Working Group (not started yet)N/ANot startedMozilla Audio APINoneNone

Forms

The ability to build rich forms with HTML is the basis for user input in most Web-based applications. Due to their limited keyboards, text input on mobile devices remains a difficult task for most users; HTML5 address parts of this problem with offering new type of form controls that optimizes the way users will enter data:

FeatureSpecificationWorking GroupMaturityStabilityLatest editors draftCurrent implementationsTest suite
Date and time entriesHTML5 Date and Time state of input elementHTML Working GroupWorking DraftStabilizingUpdated regulalryLimitedNone
Customized text entries (tel, email, url)HTML5 telephone, email and URL state of input elementStabilizingUpdated regularlyLimited (?)None
Input patternHTML5 pattern attributeStabilizingUpdated regularlyVery limited (?)None
Input hintHTML5 placeholder attributeStabilizingUpdated regularlyLimited (?)None
Pre-defined values for text entriesHTML5 datalist elementStabilizingUpdated regularlyVery limited (?)None

User interactions

An increasing share of mobile devices rely on touch-based interactions. While the traditional interactions recognized in the Web platform (keyboard, mouse input) can still be applied in this context, a more specific handling of touch-based input is a critical aspect of creating well-adapted user experiences. As a result, work has started on defining Touch Events in the DOM (Document Object Model).

Conversely, many mobile devices use haptic feedback (such as vibration) to create new form of interactions (e.g. in games); work on a vibration API is under consideration in the Device APIs & Policy Working Group (see ongoing discussions.)

But as the Web reaches new devices, and as devices gain new user interactions mechanisms, it also becomes important to allow Web developers to react to a more abstract set of user interactions: instead of having to work in terms of “click”, “key press”, or “touch event”, being able to react to an “undo” command, or a “next page” command however the user communicated it to the device will prove beneficial to the development of Web applications. Work on abstract DOM events that would address this need is planned as part of the Web Events Working Group.

Mobile devices follow their users everywhere, and many mobile users rely on them to remind them or notify them: the Web Notifications specification proposes to add that feature to the Web environment.

Mobile devices, and mobile phones in particular, are also in many cases well-suited to be used through voice-interactions; the HTML Speech Incubator Group is exploring the opportunity of starting standardization work around a framework that would make it possible for users to interact with a Web page through spoken commands (see their use cases and requirements.)

FeatureSpecificationWorking GroupMaturityStabilityLatest editors draftCurrent implementationsTest suite
Touch-based interactionsTouch Events Specification (no public draft yet)Web Events Working GroupN/AEditors draft onlyUpdated regularlyGrowing deploymentNone
VibrationN/ADevice API & PolicyN/ANot startedNot startedNoneNone
Intent-based eventsN/AWeb Events Working GroupN/ANot startedNot startedNoneNone
NotificationWeb Notifications (no public draft yet)Web Notifications Working GroupN/AEditors draft onlyRegularly updatedNoneNone
Speech-based interactionsN/AHTML Speech Incubator GroupN/AN/AUse cases and requirementsN/AN/A

Data storage

A critical component of many applications reside in the ability to save state, export content, as well as integrate data from other files and services on the system.

For simple data storage, the Web Storage specification offers two basic mechanisms, localStorage and sessionStorage, that can preserve data respectively indefinitely, or on a browser-session basis.

For richer interactions, the Web platform has a growing number of APIs to interact with a device filesystem: the File Reader API makes it possible to load the content of a file, the File Writer API allows to save or modify a file, while the nascent FileSystems API give access to more general file operations, including directory management.

On top of this file-based access, the Indexed Database API defines a database of values and hierarchical objects that integrates naturally with JavaScript, and can be queried and updated very efficiently. Note that the work around a client-side SQL-based database which had been started in 2009 has been abandoned in favor of this new system.

Applications can also benefit from integrating with existing data records; on mobile devices, the addressbook and calendar are particularly useful source of information, which the Contacts API and the Calendar API bring access to.

FeatureSpecificationWorking GroupMaturityStabilityLatest editors draftCurrent implementationsTest suite
Simple data storageWeb StorageWeb Applications Working GroupWorking DraftStabilizingUpdated regularlyWell deployedNone
File readingFile APIWeb Applications Working GroupWorking DraftStabilizingLast update Dec 2010Limited (?)None
File writingFile API: WriterWeb Applications Working GroupWorking DraftEarly draft (but starting to stabilize)Last update Oct 2010Limited (?)None
Filesystems operationsFile API: Directories and SystemWeb Applications Working GroupWorking DraftEarly draftLast update Oct 2010NoneNone
Database query/updateIndexed Database APIWeb Applications Working GroupWorking DraftStill changing, but starting to stabilizeLast update Dec 2010Very limited (?)None
Addressbook dataContacts APIDevice APIs & Policy Working GroupWorking DraftStill changing, but starting to stabilizeRegularly updatedVery limitedNone
Calendar dataCalendar API (no public draft yet)Device APIs & Policy Working GroupN/AEditors draft onlyRegularly updatedVery limitedNone

Sensors and hardware integration

Mobile devices are packed with sensors, making them a great bridge between the real and virtual worlds: GPS, accelerometer, ambient light detector, microphone, camera, thermometer, etc.

To take full advantage of these sensors in mobile Web applications, Web developers need to be provided with hooks to interact with them.

The Geolocation API provides a common interface for locating the device, independently of the underlying technology (GPS, WIFI networks identification, triangulation in cellular networks, etc.)

Work has also started on providing access to orientation and acceleration data via the DeviceOrientation Event Specification.

The System Information API proposes a generic API to get and monitor data from sensors, although the Working Group producing it is evaluating whether that generic approach is the most practical way forward.

As already mentioned in the section on multimedia, the Media Capture API opens up access to camera and microphone.

FeatureSpecificationWorking GroupMaturityStabilityLatest editors draftCurrent implementationsTest suite
GeolocationGeolocation APIGeolocation Working GroupCandidate RecommendationMostly finishedRegularly updatedWidely deployedGood coverage
Accelerometer / OrientationDeviceOrientation Event Specification (no public draft yet)Geolocation Working GroupN/AEditors draft onlyRegularly updatedLimitedNone
Generic sensorsThe System Information APIDevice APIs & Policy Working GroupWorking DraftNot clear the group will continue in the current directionLast update Jan 2011NoneNone
Camera & Microphone captureThe Media Capture APIDevice APIs & Policy Working GroupWorking DraftEarly DraftLast update Dec 2010None (?)None

Network

Network connectivity represents a major asset for mobile devices: the Web is an immense store of content, as well as an almost endless source of processing power, overcoming two of the limitations of mobile devices.

The Web platform is growing a number of APIs that facilitate establishing network connectivity in different contexts.

XMLHttpRequest (the “X” in AJAX) is a widely deployed API to load content from Web servers using the HTTP and HTTPs protocol.

A second version of that specification, XMLHttpRequest Level 2 completes the existing API with the ability to make requests on servers in a different domain, programmatic feedback on the progress of the network operations, and more efficient handling of binary content.

By default, browsers prevent from making request across different domains (or more specifically, across different origins, a combination of the protocol, domain and port); this rule protects the user from having a Web site abusing from the user credentials and data on another Web site. Sites can opt-out of that rule by making use of the Cross-Origin Resource Sharing mechanism, opening up much wider cooperation across Web applications and services.

XMLHttpRequest is useful for client-initiated network requests, but mobile devices with their limited network capabilities and the cost that network requests induce on their battery (and sometimes on their users bill) can often make better use of server-initiated requests. The Server-Sent Events API allows to trigger DOM events based on push notifications (via HTTP and other protocols.)

The WebSocket API, built on top of the IETF WebSocket protocol, offers a bidirectional, more flexible, and less resource intensive network connectivity.

Of course, an important part of using network connectivity relies on being able to determine if such connectivity exists, and the type of network available. The HTML5 onLine DOM flag (and its associated change event, ononline) signals when network connectivity is available to the Web environment.

Part of the System Information API addresses discovery of the network characteristics (e.g. WIFI vs 3G, or available bandwidth), but this proposal is likely to be recast into a more simple network-centric API (see related discussion.)

FeatureSpecificationWorking GroupMaturityStabilityLatest editors draftCurrent implementationsTest suite
HTTP(s) network APIXMLHttpRequestWeb Applications Working GroupCandidate RecommendationMostly finishedRegularly updatedWidely deployedGood coverage
XHR2XMLHttpRequest Level 2Web Applications Working GroupWorking DraftStill changing, but starting to stabilizeUpdated regularlyVery limited (?)None (?)
Cross-domain requestsCross-Origin Resource SharingWeb Applications Working GroupWorking DraftClose to stabilizingLast update November 2010Getting deployed (?)None (?)
Server-pushed requestsServer-Sent EventsWeb Applications Working GroupWorking DraftStill changing but stabilizingRegularly updatedLimited (?)None (?)
Bidirectional connectionsThe WebSocket APIWeb Applications Working GroupWorking DraftStill changing but stabilizingRegularly updatedNone (?)None
on-line stateHTML5 onLine DOM stateHTML Working GroupWorking DraftMostly stableregularly updatedGetting deployedNone
Network characteristicsNetwork Property in The System Information APIDevice APIs & Policy Working GroupWorking DraftThe group will likely NOT continue in the current direction for the network aspectsLast update Jan 2011NoneNone

Communication

Mobile devices are often communications devices; beyond connection to on-line services, allowing communications between users, but also between devices and between applications is an important aspect of a good mobile development platform.

The Messaging API completes the existing ability to create and send message through links (with sms:, mms: and mailto: URI schemes) with more control on adding attachments and the success of the message sending.

The postMessage API of HTML5 Web Messaging allows for Web Applications to communicate between each other.

Exploratory work in the Device APIs & Policy Working Group, inspired by the Web Introducer and similar works, would also open up possibilities of closer integration of Web applications.

The proposed creation of a Web Real-Time Communications Working Group (see announcement) should enable a much wider set of communication opportunity:

FeatureSpecificationWorking GroupMaturityStabilityLatest editors draftCurrent implementationsTest suite
Emails, SMS and MMS with generated attachmentsThe Messaging APIDevice APIs & Policy Working GroupWorking DraftStill subject to large changesLast update Jan 2011NoneNone
Inter-app communicationsHTML5 Web MessagingWeb Applications Working GroupWorking DraftStill changing but stabilizingRegularly updatedLimited (?)None
Inter-app triggersNonePossibly Device APIs & Policy Working GroupN/ANot startedPossible inspiration from Web IntroducerNoneNone
P2P connectionsNoneProposed Web Real-Time Communications Working GroupN/ANoneN/ANoneNone
P2P Video/Audio streamsNoneProposed Web Real-Time Communications Working GroupN/ANoneN/ANoneNone

Packaging

An important aspect of the user experience of applications is linked to how the user perceives the said application is available permanently (even when off-line, which is particularly important on mobile devices), as well as how it can shared and distributed — this is addressed by packaging the application adequately.

The Web platform offers two complementary approaches to packaging Web applications:

FeatureSpecificationWorking GroupMaturityStabilityLatest editors draftCurrent implementationsTest suite
Application CacheHTML5 Application CacheHTML Working GroupWorking DraftStill changing but stabilizingRegularly updatedGetting deployedNone
WidgetsWidgets Packaging & ConfigurationWeb Applications Working GroupLast CallMostly finishedRegularly updatedGetting deployedGood coverage
Digital Signatures for WidgetsCandidate RecommendationMostly finishedRegularly updatedGetting deployedGood coverage
Widget Access Request PolicyCandidate RecommendationMostly finishedLast update Apr 2010LimitedNone (?)

Performance & Optimization

Due to their limited CPU, and more importantly to their limited battery, mobile devices require a lot of attention in terms of performance.

The work started by the Web Performance Working Group on Navigation Timing gives tools to Web developers for optimizing their Web applications.

Beyond optimization of resources, the perceived reactivity of an application is also a critical aspect of the mobile user experience; as such, the thread-like mechanism made possible via Web Workers allows to keep the user interface responsive by offloading the most resource-intensive operations into a background process.

The Mobile Web Application Best Practices provide general advices on how to build Web applications that work well on mobile devices, taking into account in particular the needs for optimization.

FeatureSpecificationWorking GroupMaturityStabilityLatest editors draftCurrent implementationsTest suite
Timing hooksNavigation TimingWeb Performance Working GroupLast CallStabilizingRegularly updatedNone (?)None
ThreadingWeb WorkersWeb Applications Working GroupWorking DraftStabilizingRegularly updatedLimited (?)None
Optimization Best PracticesMobile Web Application Best PracticesMobile Web Best Practices Working Group (now closed)StandardFinishedN/AN/AN/A