mobile web development techniques (and opera's developer tools)

58
s a e r d n A s n e v o B s n o i t a l e R r e p o l e v e D r e d a e L p u o r G A S A e : e n o h P x a F : Mobile web development techniques and Opera’s developer tools.

Upload: andreas-bovens

Post on 09-May-2015

5.859 views

Category:

Technology


3 download

DESCRIPTION

Slides of my Mobile 2.0 workshop on mobile web development techniques. The developer tools part consisted mostly of live demos of Opera Dragonfly and the Opera Mobile emulator, which you can download from http://www.opera.com/developer/tools/ Textures from http://www.flickr.com/photos/delanydean/4460819042/ (CC by 2.0) and http://www.flickr.com/photos/poetatum/3380087493/ (CC by-nc 2.0)

TRANSCRIPT

Page 1: Mobile web development techniques (and Opera's developer tools)

saerdnA snevoB snoitaleR repoleveD redaeL puorG

ASA erawtfoS arepO

89 etag senarhT ramedlaW

neguahsnaH .tS ,8462 xoB .O.P

:enohPxaF :

:eliboM

Mobile web development techniques and Opera’s developer tools.

Page 2: Mobile web development techniques (and Opera's developer tools)

saerdnA snevoB

snoitaleR repoleveD redaeL puorG

ASA erawtfoS arepO

89 etag senarhT ramedlaW

neguahsnaH .tS ,8462 xoB .O.P

1310 olsO

yawroN

86 62 96 32 74+

10 42 96 32 74+

95 84 30 04 74+

moc.arepo@bsaerdna

moc.arepo.www

:enohP

xaF :

:eliboM

:liam-E

:etis beW

Page 3: Mobile web development techniques (and Opera's developer tools)
Page 4: Mobile web development techniques (and Opera's developer tools)
Page 5: Mobile web development techniques (and Opera's developer tools)
Page 6: Mobile web development techniques (and Opera's developer tools)
Page 7: Mobile web development techniques (and Opera's developer tools)

“Mobile web development”

Page 8: Mobile web development techniques (and Opera's developer tools)

Before: WML, XHTML-MP, XHTML basic, cHTML, i-HTML ...

CC by-nc 2.0 Jaime Pérez http://www.flickr.com/photos/jaimeperez/2562068910/

Page 9: Mobile web development techniques (and Opera's developer tools)

Before: WML, XHTML-MP, XHTML basic, cHTML, i-HTML ...

Page 10: Mobile web development techniques (and Opera's developer tools)

Mobile browser landscape has changed dramatically

CC by 2.0 Magnera http://www.flickr.com/photos/magnera/4571460751/

Page 11: Mobile web development techniques (and Opera's developer tools)

Mobile browsers can deal with “desktop” content just fine :-)

Page 12: Mobile web development techniques (and Opera's developer tools)

Small Screen Rendering

Page 13: Mobile web development techniques (and Opera's developer tools)

zoom and pan

Page 14: Mobile web development techniques (and Opera's developer tools)

...top notch standards supportmore powerful devicesfaster connections

Page 15: Mobile web development techniques (and Opera's developer tools)

“Mobile web development”

Page 16: Mobile web development techniques (and Opera's developer tools)

“Mobile web development”

=normal web development + mobile specific techniques

Page 17: Mobile web development techniques (and Opera's developer tools)

Three approachesto catering for mobile users

Page 18: Mobile web development techniques (and Opera's developer tools)

1. Do nothing

Page 19: Mobile web development techniques (and Opera's developer tools)

1. Do nothing(or at least not too much)

Page 20: Mobile web development techniques (and Opera's developer tools)

1. Do nothing(or at least not too much)

semi-liquid layout liquid layout

Page 21: Mobile web development techniques (and Opera's developer tools)

2. Create a separate mobile site

Page 22: Mobile web development techniques (and Opera's developer tools)

navigation

Page 23: Mobile web development techniques (and Opera's developer tools)

mysite.com

navigation

m.mysite.com

Page 24: Mobile web development techniques (and Opera's developer tools)

mysite.com

navigation

m.mysite.com

UserAgent sniffing

Page 25: Mobile web development techniques (and Opera's developer tools)

mysite.com

navigation

m.mysite.com

CC by-nc-sa 2.0 Tim Dorr http://www.flickr.com/photos/timdorr/2096272747/

UserAgent sniffing

Page 26: Mobile web development techniques (and Opera's developer tools)

mysite.com

navigation

m.mysite.com

UserAgent sniffing

Page 27: Mobile web development techniques (and Opera's developer tools)

mysite.com

m.mysite.com

navigation

m.mysite.com

mysite.com

UserAgent sniffing

Page 28: Mobile web development techniques (and Opera's developer tools)

mysite.com

m.mysite.com

navigation

m.mysite.com

mysite.com

set cookie

UserAgent sniffing

Page 29: Mobile web development techniques (and Opera's developer tools)

mysite.com

m.mysite.com

navigation

m.mysite.com

mysite.com

check cookie, else UserAgent sniffing

set cookie

Page 30: Mobile web development techniques (and Opera's developer tools)

page layout

Page 31: Mobile web development techniques (and Opera's developer tools)

page layout

Use normal HTML

Page 32: Mobile web development techniques (and Opera's developer tools)

page layout

Use normal HTML

Control zoom level with the viewport meta tag

Page 33: Mobile web development techniques (and Opera's developer tools)

No viewport meta tag:viewport width is interpreted as 850px, and squeezed inside browser width

Control zoom level with the viewport meta tag

Page 34: Mobile web development techniques (and Opera's developer tools)

No viewport meta tag:viewport width is interpreted as 850px, and horizontal panning is required

Control zoom level with the viewport meta tag

Page 35: Mobile web development techniques (and Opera's developer tools)

With viewport meta tag:set value is taken as viewport width, and then fit inside browser width

Control zoom level with the viewport meta tag

Page 36: Mobile web development techniques (and Opera's developer tools)

<meta name="viewport" content="width=320">

Control zoom level with the viewport meta tag

Page 37: Mobile web development techniques (and Opera's developer tools)

<meta name="viewport" content="width=320">

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

Control zoom level with the viewport meta tag

Page 38: Mobile web development techniques (and Opera's developer tools)

Control zoom level with the viewport meta tag

<meta name="viewport" content="width=320">

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

makes browser behave like there is no zoom

Page 39: Mobile web development techniques (and Opera's developer tools)

page layout

Use normal HTML

Control zoom level with the viewport meta tag

Page 40: Mobile web development techniques (and Opera's developer tools)

mysite.com

m.mysite.com

navigation

m.mysite.com

mysite.com

check cookie, else UserAgent sniffing

set cookie

Page 41: Mobile web development techniques (and Opera's developer tools)

3. Create one site that works everywhere

Page 42: Mobile web development techniques (and Opera's developer tools)

3. Create one site that works everywhere

viewport meta tag

Page 43: Mobile web development techniques (and Opera's developer tools)

3. Create one site that works everywhere

viewport meta tagmedia queries

Page 44: Mobile web development techniques (and Opera's developer tools)

media queries

Page 45: Mobile web development techniques (and Opera's developer tools)

@media screen and (max-width: 400px) {/* CSS for browser widths smaller than 400px */#nav {margin: 0}#ad {display: none;}}@media screen and (min-width: 401px) and (max-width: 800px) {/* CSS for browser widths between 401 and 800px */#ad {float: left}#content {padding: 5px;}}...

media queries

Page 46: Mobile web development techniques (and Opera's developer tools)

@media screen and (max-width: 400px) {/* CSS for browser widths smaller than 400px */#nav {margin: 0}#ad {display: none;}}@media screen and (min-width: 401px) and (max-width: 800px) {/* CSS for browser widths between 401 and 800px */#ad {float: left}#content {padding: 5px;}}...

media queries

Page 47: Mobile web development techniques (and Opera's developer tools)

media queriesdifferent layouts for all kinds of browser sizes

Page 48: Mobile web development techniques (and Opera's developer tools)

media queriesdifferent layouts for all kinds of browser sizes

What about mobile browsers with a virtual width of e.g. 850px?

Page 49: Mobile web development techniques (and Opera's developer tools)

media queriesdifferent layouts for all kinds of browser sizes

What about mobile browsers with a virtual width of e.g. 850px?

viewport meta tag to the rescue!

Page 50: Mobile web development techniques (and Opera's developer tools)

media queries

viewport meta tag

max/min-width

relates directly to the

viewport width value

Page 51: Mobile web development techniques (and Opera's developer tools)

media queries

viewport meta tag

max/min-width

relates directly to the

viewport width value

<meta name="viewport" content="width=device-width">...@media screen and (max-width: 360px) {/* CSS for browser widths smaller than 360px */#nav {margin: 0}#ad {display: none;}}...

e.g. Nokia 5800: 360px

Page 52: Mobile web development techniques (and Opera's developer tools)

1. Do nothing 2. Create a separate mobile site 3. Create one site that works everywhere

Page 53: Mobile web development techniques (and Opera's developer tools)

1. Do nothing 2. Create a separate mobile site 3. Create one site that works everywhere

“holy grail”

Page 54: Mobile web development techniques (and Opera's developer tools)

How to reach the one site holy grail?

Page 55: Mobile web development techniques (and Opera's developer tools)

How to reach the one site holy grail?

•keep mobile in mind from the very start

Page 56: Mobile web development techniques (and Opera's developer tools)

How to reach the one site holy grail?

•keep mobile in mind from the very start

•resist the “mobile context” argument, and use it the other way around: simplify your desktop layout and content

Page 57: Mobile web development techniques (and Opera's developer tools)

How to reach the one site holy grail?

•keep mobile in mind from the very start

•resist the “mobile context” argument, and use it the other way around: simplify your desktop layout and content

•reduce the number of HTTP requests

Page 58: Mobile web development techniques (and Opera's developer tools)

and now: tools! (live demo)

http://www.opera.com/developer/tools/