27

HTML5 for Tablets and Mobile

Embed Size (px)

DESCRIPTION

The explosion of HTML5-ready tablets and mobile devices has been one of the primary forces behind HTML5’s rapid coming of age. Virtually all modern devices with a web browser have broad support for the technologies defined by HTML5, like Video, Geolocation, Offline Apps, Local Storage, and CSS3 styling, making them the perfect target for aggressive HTML5 development. Targeting the look-and-feel, touch-based input, and varying screen sizes of devices can be tricky, though. This session will introduce you to the essential concepts for targeting HTML5 devices, such as Media Queries and Viewport sizing, and provide you with the tips and tricks you need to successfully develop modern web apps for tablets and mobile devices today.

Citation preview

Page 1: HTML5 for Tablets and Mobile
Page 2: HTML5 for Tablets and Mobile

@toddanglin

Page 3: HTML5 for Tablets and Mobile

31% of all Internet use in Nigeria is

mobile

Page 4: HTML5 for Tablets and Mobile

The Internet is Mobile

Page 5: HTML5 for Tablets and Mobile

100m 81m

Page 6: HTML5 for Tablets and Mobile

Which devices matter?

Page 7: HTML5 for Tablets and Mobile

iOS Android Symbian RIM MSFT …

69%

USA

58%

UK

32%

CN98%

KRWEBKIT

Page 8: HTML5 for Tablets and Mobile

HTML5 standard maximizes reusability

Page 9: HTML5 for Tablets and Mobile

considerations

1.Native-ness2.Screen Size3.Interaction4.Look-and-

feel5.Bandwidth

Page 10: HTML5 for Tablets and Mobile

What is a “native” app?

Page 11: HTML5 for Tablets and Mobile

HTML5 “Native”Looks right. * Feels right. * Available offline. * Installable. * In App Store. X Runs everywhere. X

Premium APIs X

Page 12: HTML5 for Tablets and Mobile

When is a pixel not a pixel?

Page 13: HTML5 for Tablets and Mobile

980px320px

Page 14: HTML5 for Tablets and Mobile

CSS pixelsvs.

Physical Pixels

Page 15: HTML5 for Tablets and Mobile

“If the pixel density of the output device is very different from that of a

typical computer display, the user agent should rescale pixel values.”

- CSS 2.1

Page 16: HTML5 for Tablets and Mobile

ViewPort• Configurable

<meta name="viewport" content="width=device-width, initial-scale=1.0">Optional: user-scalable=no

target-densitydpi=device-dpi (Android Only)

Page 17: HTML5 for Tablets and Mobile

media queries• Target styles to specific devices…– And features!

/*These two rules do the same thing*/@media all and (min-width:500px) { … } @media (min-width:500px) { … }

/*Multiple conditions*/@media only screen and (min-width: 600px) and (max-width: 900px) { .class { background: #333; }}

Page 18: HTML5 for Tablets and Mobile

<meta>• Rendering hints for mobile browsers

<meta name="viewport" content="width=device-width, initial-scale=1.0">Optional: user-scalable=no

target-densitydpi=device-dpi (Android Only)

<!--iOS specific--><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black" /><link rel="apple-touch-icon" href="./apple-touch-icon.png" />

Page 19: HTML5 for Tablets and Mobile

It’s a Touch,Not a Click. Right?

Page 20: HTML5 for Tablets and Mobile

Touch

• Events– touchstart– touchmove– touchend– touchcancel– gesturestart*– gesturechange*– gestureend*

Page 21: HTML5 for Tablets and Mobile

touch

• Accuracy– Size– Shape– Placement– Overlapping

Page 22: HTML5 for Tablets and Mobile

frameworks

Page 23: HTML5 for Tablets and Mobile

Mobile Internet is unpredictable.

Page 24: HTML5 for Tablets and Mobile

bandwidth

• Optimize design– Clicks/Screens– Graphics

• Selectively load resources

Page 25: HTML5 for Tablets and Mobile

Future

• “Windows 8”• Chrome OS• Facebook

Page 26: HTML5 for Tablets and Mobile

@htmlui

Page 27: HTML5 for Tablets and Mobile

Resources