KEMBAR78
Web Development for Mobile: GTUG Talk at Google | PPTX
Mobile Web DevelopmentEstelle Weylhttp://standardista.comhttp://evotech.net/blog@estellevw
Native or Web???2Source: Jonathan Stark
3
With HTML5 & CSS34
http://findmebyip.com/litmus/
CSS2.1
CSS3Unfinished, but well supported
iPhone/Android = WebkitNo Cross browser testing!!!
CSS3Mobile Webkit Supports  all of CSS3Mobile Webkit Supports  HTML5almost^much of^
CSS3 PropertiesCSS3 SelectorsHSLA / RGBAMultiple backgroundsBackground-sizeBorder-radiusBorder-imageText ShadowBox Shadow Opacity10Text-overflow
Gradients
Transforms
Columns
Animations
Transitions
Border-image
Reflections
@font-faceHTML5 APIsLocal StorageSession StorageWebSQL dBOffline ApplicationsGeoLocationpostMessage11Query selector ??
Drag & Drop
<canvas>, <svg>, <audio>, <video>
Web FormsHTML5 <input> Typesdate  /time / datetime  / datetime-local  / month / weekemail url12Tel
Number
Range
searchInput Behavior13Keyboard support ≠ Input Type Support
iPhone v. Android v. desktopInput file type does Not work on iPhone. <a href=“tel:14155551212>Call me</a>mailto: opens mail applicationgoogle maps, iTunes and Youtube links open widgets on iPhoneview source            debugger✔14
Mobile Simulators15
Debugging?Switch user agent to iPhone / OtherUse Web Inspector to debug16
Firebug for Mobile?Settings > Safari > Developer > Debug Console17Android Debug Bridge (ADB)
Beautiful bookmarks<link rel="apple-touch-icon" href="/iphoneicon.png" />apple-touch-icon.png(or apple-touch-icon-precomposed.png)18
Android bookmarks<link rel="apple-touch-icon" href="/iphoneicon.png" />apple-touch-icon.png19
Mobile web app settings<link rel="apple-touch-startup-image" href="/startup.png"><meta name="apple-mobile-web-app-capable" content="yes" />  <meta name="apple-mobile-web-app-status-bar-style" content=“default || black || black-translucent" /> (iPhone only)20
Targeting MobileViewport:<meta name="viewport" content="width=980”/><meta name="viewport" content="width=device-width”/><meta name="viewport"            content="user-scalable=no, width=device-width"/>Prohibit Zoom / Pinch:<meta name="viewport" content="width=device-width,             minimum-scale=1.0, maximum-scale=1.0" /> 21
@media queries min-width
 max-width
 device-width
 min-device-width
 max-device-width
 orientation
 -webkit-min-device-pixel-ratio@media screen and (max-device-width: 480px){        /* small screen CSS here */ } 22
@media screen and (???){ …}Portrait & Landscape    (min-width: 320px) and (max-width: 480px)Portrait & Landscape     (min-device-width: 320px) and (max-device-width: 480px)Portrait & Landscape     (max-device-width: 480px)Landscape only	(min-width: 321px) and (max-width: 480px)Portrait only      (max-width: 320px) 23
iPadPortrait & Landscape    (min-device-width: 768px) and (max-device-width: 1024px)Landscape only	(min-device-width: 481px) and      (max-device-width: 1024px) and       (orientation: landscape)Portrait only      (min-device-width: 481px) and       (max-device-width: 1024px) and       (orientation: portrait)24
25
Hide the Title bar<script>addEventListener("load", function() { 		setTimeout(hideURLbar, 0); }, false);		function hideURLbar(){				    window.scrollTo(0,1);	}}		</script>26
Don’t reinvent the wheel27
Sencha Touch28http://glyphish.com/http://graffletopia.com/stencils
29http://10k.aneventapart.com
30
31
32Gradients

Web Development for Mobile: GTUG Talk at Google

Editor's Notes

  • #11 standardista
  • #12 standardista
  • #13 standardista
  • #17 Mozilla/5.0 (Linux; U; Android 2.1; en-us; Nexus One Build/ERD62) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17 Switching user agent only matters if browser sniffingMozilla/5.0 (Linux; U; Android 2.1; en-us; Nexus One Build/ERD62) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17
  • #19 selecting the +, or &apos;add bookmark&apos; from the bottom nav, selecting &quot;Add to Home Screen&quot; from the bookmarks menuOptionally editing the title of the bookmark, andSelecting &quot;Add&quot;.
  • #20 selecting the +, or &apos;add bookmark&apos; from the bottom nav, selecting &quot;Add to Home Screen&quot; from the bookmarks menuOptionally editing the title of the bookmark, andSelecting &quot;Add&quot;.
  • #22 Safari on iPhone OS displays webpages at a scale that works for most web content originally designed for the desktop. If these default settings don’t work for your webpages, it is highly recommended that you change the settings by configuring the viewport. You especially need to configure the viewport if you are designing webpages specifically for iPhone OS. Configuring the viewport is easy—just add one line of HTML to your webpage
  • #23 Safari on iPhone OS displays webpages at a scale that works for most web content originally designed for the desktop. If these default settings don’t work for your webpages, it is highly recommended that you change the settings by configuring the viewport. You especially need to configure the viewport if you are designing webpages specifically for iPhone OS. Configuring the viewport is easy—just add one line of HTML to your webpage
  • #24 Safari on iPhone OS displays webpages at a scale that works for most web content originally designed for the desktop. If these default settings don’t work for your webpages, it is highly recommended that you change the settings by configuring the viewport. You especially need to configure the viewport if you are designing webpages specifically for iPhone OS. Configuring the viewport is easy—just add one line of HTML to your webpage
  • #25 Safari on iPhone OS displays webpages at a scale that works for most web content originally designed for the desktop. If these default settings don’t work for your webpages, it is highly recommended that you change the settings by configuring the viewport. You especially need to configure the viewport if you are designing webpages specifically for iPhone OS. Configuring the viewport is easy—just add one line of HTML to your webpage
  • #26 Safari on iPhone OS displays webpages at a scale that works for most web content originally designed for the desktop. If these default settings don’t work for your webpages, it is highly recommended that you change the settings by configuring the viewport. You especially need to configure the viewport if you are designing webpages specifically for iPhone OS. Configuring the viewport is easy—just add one line of HTML to your webpage
  • #28 Sorry, but no source was attributed
  • #29 Javascript LibrariesEasiest to use is Joe Hewitt’s IUIMore full featured is JQTouchFor full fledged apps, Sencha Touch.
  • #33 GRADIENTS
  • #34 http://developer.apple.com/safari/library/documentation/internetweb/conceptual/safarivisualeffectsprogguide/Gradients/Gradients.html
  • #39 .foo { background-image: url(bg-image.png); -moz-background-size: 100% 100%; /* Gecko 1.9.2 (Firefox 3.6) */ -o-background-size: 100% 100%; /* Opera 9.5 */ -webkit-background-size: 100% 100%; /* Safari 3.0 */             background-size: 100% 100%; /* Gecko 2.0 (Firefox 4.0) and other CSS3-compliant browsers */ -moz-border-image: url(bg-image.png) 0; /* Gecko 1.9.1 (Firefox 3.5) */Background-size:= [ &lt;length&gt; | &lt;percentage&gt; | auto ]{1,2} | cover | contain }