mobile web€¦ · apps vs. web apps ui control deep integration native == ‘natural’...

70
Mobile Web 15/11/2013 Jon Madden, Arnaud Brousseau

Upload: others

Post on 16-Oct-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

Mobile Web15/11/2013

Jon Madden, Arnaud Brousseau

Page 2: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

Why Mobile?

Page 3: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

The world is mobile

Page 4: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’
Page 5: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’
Page 6: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

What does “mobile” mean?Before iPhone

Page 7: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

What does “mobile” mean?

Page 8: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

What does “mobile” mean?

Page 9: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

What does “mobile” mean?

Page 10: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

Apps vs. WebApps● UI control● deep integration● native == ‘natural’● implementation is

platform specific● marketplaces

Web● HTML5● often ‘slow’,

‘unintuitive’● platform agnostic● no barriers to

access

Page 11: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

Apps vs. Web (users)Apps● high level of

engagement● trendsetters

Web● varying

engagement● googlers

Page 12: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

Web: ‘page’ vs ‘app’Web page (traditional)● read● information oriented● multiple stand alone

pages● wikipedia

Web app● read/write● “does” something● often a single page

app● twitter

Page 13: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

The other mobile webThere is also an internet for dumb phones● WAP

○ uses special protocols● SMS widely used in

the developing world

Page 14: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

Embracing Mobile

Page 15: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

Some mobile sites● Food network● Flickr● Twitter● Apple● m.yelp

Page 16: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

What Does It Mean?Time to rethink design/engagement/market strategies● Options:

○ Mobile first○ Responsive○ Separate (but equal?) sites

● Markets are still figuring this out

Page 17: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

Mobile first● generally pertains to apps● forces focus to MVP● very quick iterations/feedback loops● graduate via progressive enhancement to

become full product

Page 18: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

Mobile firster: Rovio

Page 19: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

Mobile firster: Instagram (1bn)

Page 20: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

Mobile impact: Apple vs. Microsoft

Page 21: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

It’s hard to get right

Page 22: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

The Mobile Web Platform● standards based expression of content● the most correct answer (for now)● HTML5 - so awesome● We’ve been here before

Page 23: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

How To: Adapt Content

Page 24: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

HTML

Fluid defaults(through browsers’ default stylesheet)

Page 25: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’
Page 26: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

Heavy HTML

Reality

Desktop-specific CSS

Desktop-specific JavaScript

Page 27: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’
Page 28: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

Heavy HTML

Responsive web design

Desktop-specific CSS

JavaScript

CSS Media Queries

Page 29: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

/* desktop-specific styles */#content { padding: 10px; }

@media screen and (max-width: 320px) { #content { padding: 5px; } #sidebar { display: none; }}

Live Demo

Page 30: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

<link rel='stylesheet' href='css/styles.css' />

<link rel='stylesheet' media='screen and (max-width: 320px)' href='css/mobile.css' />

#content { padding: 10px; } #content { padding: 5px; }#sidebar { display: none; }

Page 31: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’
Page 33: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

(Light?) HTML

Mobile first

Mobile-specific CSS

JavaScript

CSS Media Queries

Page 34: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

/* mobile-specific styles */#content { padding: 5px; }#sidebar { display: none; }

@media screen and (min-width: 320px) { #content { padding: 10px; } #sidebar { display: block; }}

Live Demo

Page 35: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

<link rel='stylesheet' href='css/styles.css' />

<link rel='stylesheet' media='screen and (min-width: 320px)' href='css/desktop.css' />

#content { padding: 5px; }#sidebar { display: none; }

#content { padding: 10px; }#sidebar { display: block; }

Page 36: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

(Light?) HTML

Mobile-specific CSS

JavaScript

CSS Media Queries

Heavy HTML

Desktop-specific CSS

JavaScript

CSS Media Queries

Mobile firstResponsive web design

Page 37: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

Light HTML

Dedicated mobile site

Mobile-specific CSS

JavaScript

Page 38: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’
Page 39: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

Page 40: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

User agents (UAs)When a software agent operates in a network protocol, it often identifies itself [...] by submitting a characteristic identification string to its operating peer. In HTTP [...] this identification is transmitted in a header field User-Agent.

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36

mozilla/5.0 (iphone; cpu iphone os 7_0_2 like mac os x) applewebkit/537.51.1 (khtml, like gecko) version/7.0 mobile/11a501 safari/9537.53

Funny blog post about UA...

Page 41: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

GET / HTTP 1.1Host: http://www.yelp.comUser-Agent: “Mozilla/5.0 (Windows NT 6.2; Win64;...”

Page 42: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’
Page 43: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

GET / HTTP 1.1Host: http://www.yelp.comUser-Agent: “Mozilla/5.0 (iPhone; CPU iPhone OS…”

Page 44: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’
Page 46: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

CAUTION<img> tags considered

tricky

● Different screen sizes● Different screen densities● Slow mobile networks

(performance headache)

Article on existing solutionsSerious proposal: Client-Hints

Page 47: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

How To: Master Viewport

Page 48: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

Desktop

Page 49: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

Mobile

Initial viewport

Page 50: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

Visible areaMobile

When you zoom in

Page 51: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

Visible areaMobile

Page 52: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

<meta name="viewport" content="width=device-width">

Page 53: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

<meta name="viewport" content="initial-scale=1, user-scalable=no">

Page 54: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

How To: Access Hardware

Page 55: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

● Camera● GPS● Touch/Gestures● Battery Status● Vibrations● File System● Even Ambient Pressure!● ...and more

How?

Page 56: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’
Page 57: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

navigator.geolocation.getCurrentPosition(function(pos) { // YOU NOW KNOW WHERE THE USER IS. Look at: // pos.coords.latitude // pos.coords.longitude});

Live Demo

Page 58: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

navigator.getUserMedia('video', function(stream) { // Access to a stream, straight from the camera});

Live Demo

Page 59: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

Gonk Kernel, core OS (Linux based)

Gecko Rendering engine, Also found in Firefox.

Gaia Interface of this phone. Gaia is a WEB APP

Page 60: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

How To: Deal With Touch

Page 61: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

→ Click→ Hover→ Keyup

Page 62: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

myElem.addEventListener(‘click’, function(e) { // will execute when myElem is clicked});

Page 63: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

→ pinch/zoom→ swipe→ rotate

Page 64: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

myElem.addEventListener(‘touchstart’, function(e) { // will execute when myElem is touched});

Live Demo

Page 65: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

Antipatterns:● Hover menus● Keyboard-driven interactions● Rely on ‘click’, ‘mousedown’, ‘mouseup’

^^ That’s how the web was build before touch interactions were around!

Page 66: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

How Mobile Browsers “Fixed” The Web:

Page 67: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

Touch? Click?Both!

Page 68: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

myElem.addEventListener(‘pointermove’, function(e) { // will execute when myElem is moved: // - with a mouse // - with a finger // - through a Kinect});

The Future

Page 70: Mobile Web€¦ · Apps vs. Web Apps UI control deep integration native == ‘natural’ implementation is platform specific marketplaces Web HTML5 often ‘slow’, ‘unintuitive’

Questions?

Nope. We don’t bite.