16. Common pitfalls Don’t forget that Data traffic is expensive The the network is slow The device has lower processing power That the interaction model is unknown That the screen is smaller
17. Context Hardware OS Physical capabilities tech perspective Browser WRT App Social networks Local user profile CRM Superlocal Home/abroad Telco network WiFi Bandwidth
18. Logic is moving More front-end! Get started! Feature detection, not device detection
19. View port The visual part of the web site http://www.flickr.com/photos/dm-set/3579287485/
20. On a desktop viewport = size of <html/> = size of the browser window
22. Layout viewport default width iPhone Safari: 980px Opera: 850px AndriodWebKit: 800px IE: 974 px Symbian WebKit: Tries to keep the layout viewport equal to the visual viewport. BadaWebkit: layout viewport as wide as the widest element Blackberry: layout viewport equals the visual viewport at 100% zoom
23. Best user experience when visual view port width = layout view port width = device-width
24. 1px != 1px iPhone 4 has 640 physical pixels, but layout viewport is 320 “High DPI” screens “CSS pixels” Zoom level Not the same as physical pixels on the device Decides how many physical pixels a CSS pixel covers Read More: http://www.quirksmode.org/mobile/viewports.html http://www.flickr.com/photos/korosirego/
27. Users ZoomBaby steps: How to make use of this? http://www.flickr.com/photos/andrewrennie/
28. Overriding the default <meta name="viewport" content="width=240, height=320, user-scalable=yes, initial-scale=2.5, maximum-scale=5.0, minimum-scale=1.0" /> Width/Height of viewport Zoomable? Initial zoom <meta name="viewport” content="target-densitydpi=device-dpi" /> device-dpi: Use the device's native dpi as target dpi. low-dpi: 120dpi medium-dpi: 160dpi, which is also the default as of today high-dpi: 240dpi <number>: We take any number between 70 and 400 as a valid target dpi. 4 has 640 physical pixels, but layout viewport is 320
31. Media queries Target size of viewport with a different CSS <link rel="stylesheet" type="text/css” media="only screen and (max-width: 480px), only screen and (max-device-width: 480px)” href=“small-device.css" /> Landscape or portrait? <link rel=”stylesheet” media=”all and (orientation:portrait)” href=”portrait-style.css” /> <link rel=”stylesheet” media=”all and (orientation:landscape)” href=”landscape-style.css” /> <link media=”all and (-webkit-min-device-pixel-ratio:2)” href=”highDPI.css” type=”text/css” rel=”stylesheet” /> High DPI screens
32. Detect iPad if(navigator.platform== "iPad”){ //put iPadcss into the dom } @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) { /* “iPad” style*/ }
59. HTTP response header 200 OK Connection: close Date: Tue, 04 Jan 2011 20:05:52 GMT Server: Apache Content-Type: text/html; charset=UTF-8 Client-Date: Tue, 04 Jan 2011 20:05:52 GMT Client-Peer: 89.221.244.18:80 Client-Response-Num: 1 Vary: Accept,User-Agent Cache-Control: no-transform, max-age=3600 Expires: <some time in the future> Last-Modified: <some time in the past> Allow caching. Don’t forget images, css and js http-headers
60. Mobile SEO 140 bill web searches pr month x 5%on mobile = 6-8 billion mobile searches Make search engines aware of your site. Submit a mobile site map Handle mobile crawlers Enable deep linking Meta tags <meta name=“Handheldfriendly” content=“true”/> <meta name=“MobileOptimized” content=“240”/> <link rel=“alternate” media=“handheld” href=“”/>
61. Redirect mobile user agents Not bullet proof! Client side or server side Deep linking <script language=javascript> if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))){ if(confirm('Hey, is it an apple in your hand? Mobile site?')) location.replace("URL HERE"); } </script>
62. Is the mobile web becoming desktop-web-like?…or is the web becoming more mobile aware? Jon Arne Sæterås Product Director, Mobiletech Twitter: @jonarnes Email: jas@mobiletech.mobi
Notas del editor
Betyrmer front end!
@media only screen and (-webkit-min-device-pixel-ratio: 2) { // CSS goes here }if (navigator.connection.type==navigator.connection.WIFI) {}