Best Practices for developing Mobile Web Applications 23 September - - PowerPoint PPT Presentation

best practices for developing mobile web applications
SMART_READER_LITE
LIVE PREVIEW

Best Practices for developing Mobile Web Applications 23 September - - PowerPoint PPT Presentation

Best Practices for developing Mobile Web Applications 23 September 2011 Open World Forum 2011, Paris, France Dominique Hazal-Massieux <dom@w3.org> http://kwz.me/ps This project is funded by the European Union through the Seventh


slide-1
SLIDE 1

Best Practices for developing Mobile Web Applications

23 September 2011 Open World Forum 2011, Paris, France Dominique Hazaël-Massieux <dom@w3.org> http://kwz.me/ps

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)
slide-2
SLIDE 2

W3C

Funded and directed by Web inventor Tim Berners-Lee International consortium of 320 organizations (w3.org/join) Staff of 60 in Europe, USA, Japan Home of HTML5, CSS, SVG, JavaScript APIs, etc. Dedicated efforts around mobile

slide-3
SLIDE 3

Mobile

Different constraints Different opportunities

slide-4
SLIDE 4

Constraints

smaller physical screens difficult to use keyboards no mouse lesser network connectivity reduced CPU & memory diversity & fragmentation different usage patterns

slide-5
SLIDE 5

Advantages

always available intuitive touch interfaces full of sensors easy access to audio & video different usage patterns

slide-6
SLIDE 6

Mobile Web

Adapt layout Adapt input Reduce network usage Reduce CPU & memory usage Adapt content

slide-7
SLIDE 7

Layout

physical sizes: 3-4" Resolution: 120-800px wide Portrait orientation Older browsers: partial screen view Recent browsers: zoomed out Scroll bars and zooming best avoided

slide-8
SLIDE 8

Adapting Layout

Avoid zoom:

viewportwidth=device-width

Adapt style to screen size:

  • media='screen and (min-width:600px)'

Use liquid or elastic layout, preferably in single column

slide-9
SLIDE 9

Input

keyboard:

Keypad: text entry difficult physcial keyboard: tiny keys touch keyboard: slow, takes up screen space

no mouse; increasingly touch-based UI

slide-10
SLIDE 10

Reducing text entry

tel email date datalist

Soon (?):

speech

slide-11
SLIDE 11

No mouse

large hit targets for touch-based devices sequential navigation in the page touchstart, touchmove, touchend events

slide-12
SLIDE 12

Network

limited bandwidth high latency network traffic costly or under quota

  • n and off
slide-13
SLIDE 13

Reduce Network Usage

Minify/gzip markup, stylesheets, scripts Use HTTP caching:

  • Reduce size and number of external resources:

images (CSS sprites, EXIF data, optimization) scripts (JS libraries) aggregate stylesheets

Use for partial updates Optimize cookies

slide-14
SLIDE 14

Prepare for Offline Operations

Data storage:

localStorage

Better, but later:

indexedDB.open

Offline caching:

manifest

slide-15
SLIDE 15

CPU & memory

slower CPUs CPU usage drains battery more limited memory

slide-16
SLIDE 16

Optimize CPU & memory usage

Resize images on the server Avoid long-running scripts Limit page reflow and repaints Limit size of pages, script objects Limit network usage

slide-17
SLIDE 17

Diversity & Fragmentation

Much more diversity than on computers Wide-ranging capabilities among browsers

slide-18
SLIDE 18

Content Adaptation

Responsive Web Design:

CSS Media Queries Mobile first JavaScript Feature detection

Server-side content adaptation

slide-19
SLIDE 19

Mobile Web Applications

vs “Native” Apps freedom to deploy and update cross-platform, cross-devices

slide-20
SLIDE 20

Building Mobile Web Applications

Slicker UI Sensors Hardware Better use of network

slide-21
SLIDE 21

Slicker User Interfaces

SVG CSS3 animations & transformations canvas

The other side! Mouse over this circle

slide-22
SLIDE 22

Sensors

Geolocation:

geolocation.getCurrentPosition(…)

Accelerometer / gyroscope:

devicemotion

slide-23
SLIDE 23

Hardware (soon)

Battery:

batterybatterylow

Camera / Mike:

getUserMedia

slide-24
SLIDE 24

Better connectivity

Adapt to network type:

navigator.connection.type

Optimize polling:

EventSource()

  • Bidirectional connection:

WebSocket

  • Soon, P2P connection:

PeerConnection

slide-25
SLIDE 25

UI + Sensor + Network

slide-26
SLIDE 26

Web & Connected devices

computers phones tablets TVs soon: cars, home automation, cameras, etc.

slide-27
SLIDE 27

Learn more

Relever le défi du Web mobile, ed. Eyrolles Mobile Web Initiative Web site, with Best Practices W3C on-line training on Mobile Web Applications Standards for Web applications on mobile http://kwz.me/ps

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)