W3C Mobile Web Initiative

Take it easy with W3C standards and tools for mobile

François Daoust <fd@w3.org>
W3C Mobile Web Initiative

http://www.w3.org/2009/Talks/09-overtheair/

Over the Air
Imperial College London, UK, 25-26 September 2009

EU FP7 Logo
Supported by MobiWeb2.0, funded by European Union's FP7.

Outline

Table of Contents
Photo by Elaine Vallet

  1. The World Wide Web Consortium
  2. Mobile standards, software and tools
  3. The Web as platform, on-going works to bridge the gap

First part:
The World Wide Web Consortium

The W3C

Leading the Web to its full potential...

Portrait of Tim Berners-Lee

Web standards

Standards are bricks on top of which anyone can build
Photo by Elaine Vallet

X(HTML), CSS, XML, SVG, PNG, WCAG, RDF, XSLT, ...
Privacy, Semantic Web, Accessibility, eGovernement, Mobile Web, ...

The W3C in practice

The W3C is a set of tables around which members gather and sit to discuss and agree on something The W3C is a process that ensures resulting standards are stable and interoperable
The W3C is a technical team that ensures standards consistency
Photos by mnadi and psd

The Mobile Web Initiative

Sponsors of the W3C Mobile Web Initiative

Tim Berners-Lee Making Web access from a mobile device as simple as Web access from a desktop device.
Tim Berners-Lee, W3C Director and inventor of the Web

Standards, but also software and tools!

The popular W3C Markup Validator

The W3C Markup Validator is probably the most well-known tool...
It's not the only one!

Second part:
Mobile standards, software and tools

The Mobile Web Best Practices...
+ mobileOK™
+ flipcards
+ the W3C mobileOK Checker
+ some stats
+ training courses

Mobile Web Best Practices - Overview

Mobile Web Best Practices in handy flipcards

Mobile Web Best Practices 1.0:

The mobileOK mark

Le logo mobileOK

From Best Practices to mobileOK

The mobileOK Checker Java library is a reference of the mobileOK Basic Tests 1.0 specification that defines formal tests to run to check a consistent set of Mobile Web Best Practices

The W3C mobileOK Checker

http://validator.w3.org/mobile

The online W3C mobileOK Checker

Categories and severity

Errors are categorized and assigned a severity level to educate authors about the main problems that affect the mobile-friendliness of their page

Encourage time-constrained authors
to address critical problems first

Score and page statistics

The mobileOK score, between 0 and 100, encourages authors to improve the mobile-friendliness of the page

Level of Adherence to Best Practices

Mobile Web Best Practices not followed
Best Practice Best Practice explained URIs (%) Domains (%)
VALID_MARKUP Create documents that validate to published formal grammars. 77% 87%
MEASURES Do not use pixel measures and do not use absolute units in markup language attribute values and style sheet property values. 58% 68%
PAGE_SIZE_LIMIT Ensure that the overall size of page is appropriate to the memory limitations of the device. 54% 66%
CHARACTER_ENCODING_USE Indicate in the response the character encoding being used. 49% 61%
IMAGES_SPECIFY_SIZE Specify the size of images in markup, if they have an intrinsic size. 48% 58%
CONTENT_FORMAT_SUPPORT Send content in a format that is known to be supported by the device. 39% 51%
CACHING Provide caching information in HTTP responses. 39% 50%
TABLES_LAYOUT Do not use tables for layout. 34% 38%
POP_UPS Do not cause pop-ups or other windows to appear and do not change the current window without informing the user. 30% 34%
HTTP_RESPONSE (Not a real best practice) 27% 33%

Training courses on MWBP

Training courses on the Mobile Web Best Practices

The Device Description Repository Simple API...
+ an implementation in PHP

The DDR Simple API

The DDR Simple API provides a simple API for access to Device Description Repositories

Common API for access to Device Description Repositories

PHP implementation of the DDR Simple API

Generic implementation of the DDR Simple API along with a simple implementation on top of WURFL

Generic implementation that may be re-used for access to other DDRs,
simple implementation on top of WURFL
http://dev.w3.org/cvsweb/2009/mobileok-authoring/common/ddrsimpleapi/

The Web Compatibility Test for Mobile Browsers

The Web Compatibility Test for Mobile Browsers (1/2)

Screenshot of the Web Compatibility Test for Mobile Browsers

http://www.w3.org/2008/06/mobile-test/
QR Code to access the WCTMB

The Web Compatibility Test for Mobile Browsers (2/2)

Tests basic support for common Web technologies

POWDER
+ the mobileOK POWDER Generator

POWDER

Example of a POWDER document proposed by the W3C mobileOK Checker that claims that the W3C MWI home page is mobileOK

Machine-readable claims about a set of resources
http://www.w3.org/TR/powder-primer/

mobileOK POWDER Generator

The mobileOK POWDER generator allows users to make more complex mobileOK claims on a set of URIs

mobileOK™ is one of the use cases of POWDER
http://i-sieve.com/cgi-bin/mobileOK.cgi

Other tools...

Other tools...

The Web as platform
Ongoing works

The Web as platform...
for mobile devices too

From a classic client-server architecture...

Before Web 2.0, clients could not interact with servers.

... to an architecture of participation

The Web as platform allows interaction between all stakeholders. The server becomes an endpoint and needs to be opened to be able to talk with devices it was not necessarily designed for in the first place.

W3C Widgets

Widgets Packaging and Configuration

Basic widget wrapper:

	<widget xmlns='http://www.w3.org/ns/widgets'>
	  <name>Hello world!</name>
	</widget>
	

Widgets Digital Signature

For signing and verifying widgets

Widgets APIs and Events

	function getDiagonalSize(){
	  var x   = widget.width;  
	  var y   = widget.height;  
	  var hyp = Math.sqrt(x*x + y*y);
	  return hyp;
	}

Widgets Access Requests Policy

Security model controlling network access from within a widget.

Widgets Updates

Auto-update mechanism.

W3C Widget Checker

The Widget Checker, derived from the mobileOK Checker Library, aims at checking widgets against the Widget suite of specification when it reached version 1.0

Alpha unstable version: http://qa-dev.w3.org:8001/widget/
(re-uses the mobileOK Checker library!)

Mobile Web Application Best Practices

Minimize Perceived Latency

What it means

A conservative use of resources will help to minimize the latency of a Web application, but a number of measures can also be used to further minimize the perceived latency.

How to do it

Place JavaScript tags at the bottom of the page.

	
	  <html>
	    <head>
	      [...]
	    </head>
	    <body>
	      [...]
	      <script type="text/javascript" src="script.js"></script>
	    </body>
	  </html>
      

Got threads?

Web Workers

	var worker = new Worker('worker.js');
	worker.onmessage = function (event) {
	  document.getElementById('result').textContent = event.data;
	};
      

Web Storage and Web Database

Web Storage

Persistent data storage of key-value pair data in Web clients:

	sessionStorage.foo='bar';
	localStorage.fooo='bar';
      

Web Database

Query data using SQL in Web clients:

	db.readTransaction(function (t) {
	  t.executeSql('SELECT title, author FROM docs WHERE id=?', [id], function (t, data) {
	    report(data.rows[0].title, data.rows[0].author);
	    });
	  });
      

HTML5 - Offline Web Applications

http://www.w3.org/TR/html5/offline.html

HTML5 - New form controls

	<input type="email" >
	<input type="date" >
	<input type="range" >
	<input type="color" >
      

More semantics allow for more automation on mobile devices.

HTML5 - Canvas

Canvas vs. SVG?

	
	  // canvas is a reference to a <canvas> element
	  var context = canvas.getContext('2d');
	  context.fillRect(0,0,50,50);
	  canvas.setAttribute('width', '300'); // clears the canvas
	  context.fillRect(0,100,50,50);
	  canvas.width = canvas.width; // clears the canvas
	  context.fillRect(100,0,50,50); // only this square remains
	
      

Geolocation API

Last Call working draft
http://www.w3.org/TR/geolocation-API/
(implementations in Firefox 3.5, Safari Mobile, Google Gears)

	
	function showMap(position) {
	 // Show a map centered at:
	 // - position.coords.latitude
	 // - position.coords.longitude
	}
	
	// One-shot position request.
	navigator.geolocation.getCurrentPosition(showMap);
      

Device APIs

Device APIs and Policy Working Group
http://www.w3.org/2009/dap/

Starting points:

Not restricted to mobile devices!

Conclusion

Buzz words

Conclusion (1/2)

If you want to delve into a spec,
there's a tool for that!

Open Source Software at W3C:
http://www.w3.org/Status

Conclusion (2/2)

The Web as platform
is around the corner.

Post-Scriptum

There's just One Web!

The End

Contact

François Daoust <fd@w3.org>

W3C Mobile Web Initiative
http://www.w3.org/2009/Talks/09-overtheair/

Training courses on the Mobile Web Best Practices

  • Online course: 12th October 2009
  • Face to face course: 14th October 2009, in Cambridge

EU FP7 Logo
Supported by MobiWeb2.0,
funded by European Union's FP7.