Building a Mobile Web App with HTML5

This project is funded by the European Union through the Seventh Framework Programme (FP7/2010-2012) under grant agreement n°257800
- Mobile Web Applications (MobiWebApp)

W3C

Mobile

Constraints

Advantages

Mobile Web

Layout

Adapting Layout: viewport

Default rendering viewport: 800 to 1000px wide

Adapted viewport with<meta name='viewport' content=''>

Adapting Layout: style

Adapt style to screen size:

<link rel='stylesheet' href='default.css'>
<link rel='stylesheet' href='large_screen.css'
    media='screen and (min-width:600px)'>

Use liquid or elastic layout, preferably in single column

Input

Reducing text entry

<input type=tel>
<input type=email>
<input type=date>
<datalist><option value=…></datalist>

Soon (?):

<input type='text' speech>

No mouse

Network

Reduce Network Usage

Prepare for Offline Operations

Data storage:

window.localStorage

Better, but later:

var db = window.indexedDB.open(dbname);

Offline caching:

<html manifest='manifest_file'>

CPU & memory

Optimize CPU & memory usage

Diversity & Fragmentation

Content Adaptation

Mobile Web Applications

Building Mobile Web Applications

Slicker User Interfaces

Mouse over this circle

The other side!

Sensors

Geolocation:

navigator.geolocation.getCurrentPosition(…)

Accelerometer / gyroscope:

addEventListener('devicemotion', …)

Hardware (soon)

Battery:

navigator.battery.
   addEventListener('dischargingtimechange', …)

Camera / Mike:

navigator.getUserMedia({video:true,audio:true},…)

Better connectivity

Adapt to network type:

if (navigator.connection.type) == "3g") { … }

Optimize polling:

var eventsource = new EventSource();
eventsource.onmessage = function(event) { … }

Bidirectional connection:

var socket = new WebSocket(
            'ws://game.example.com:12010/updates');
	  socket.onopen = function () { …};

Soon, P2P connection:

var connection = new PeerConnection('STUNS example.net',
                          signalingCallback);

UI + Sensor + Network

Web & Connected devices

Learn more

MobiWebApp logo

This project is funded by the European Union through the Seventh Framework Programme (FP7/2010-2012) under grant agreement n°257800
- Mobile Web Applications (MobiWebApp)