coding for mobile week 13 tcnj web 2 jean chu. web is dead. long live the internet

12
Coding for Mobile Week 13 TCNJ Web 2 Jean Chu

Upload: berenice-booker

Post on 04-Jan-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Coding for Mobile Week 13 TCNJ Web 2 Jean Chu. Web is Dead. Long live the Internet

Coding for Mobile

Week 13TCNJ Web 2

Jean Chu

Page 2: Coding for Mobile Week 13 TCNJ Web 2 Jean Chu. Web is Dead. Long live the Internet

Web is Dead. Long live the Internet

http://www.wired.com/magazine/2010/08/ff_webrip/all/1

Page 3: Coding for Mobile Week 13 TCNJ Web 2 Jean Chu. Web is Dead. Long live the Internet

http://www.wired.com/magazine/2010/08/ff_webrip/all/1

Page 4: Coding for Mobile Week 13 TCNJ Web 2 Jean Chu. Web is Dead. Long live the Internet

CODING WEB FOR MOBILE

Page 5: Coding for Mobile Week 13 TCNJ Web 2 Jean Chu. Web is Dead. Long live the Internet

Mobile Specific Meta Tags

<meta name = "viewport" content = "width = device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;" />

<meta name="HandheldFriendly" content="True" />

Page 6: Coding for Mobile Week 13 TCNJ Web 2 Jean Chu. Web is Dead. Long live the Internet

Detect the browser and redirect

Detect the Browser<?php $_SERVER[‘HTTP_USER_AGENT’];

?>

Redirect to the mobile page<?php header('Location: http://www.example.com/'); ?>

Page 7: Coding for Mobile Week 13 TCNJ Web 2 Jean Chu. Web is Dead. Long live the Internet

Detect the browser and redirect- Easy Way to Use a library

http://www.detectmobilebrowsers.mobi/

require_once('mobile_device_detect.php');$mobile

=mobile_device_detect(true,false,true,true,true,true,true,'http://www.domain-name.com/m/',false);

Page 8: Coding for Mobile Week 13 TCNJ Web 2 Jean Chu. Web is Dead. Long live the Internet

Extra : Click to Call Mobile

<a href="tel:555-555-5555">555-555-5555</a>

Page 9: Coding for Mobile Week 13 TCNJ Web 2 Jean Chu. Web is Dead. Long live the Internet

Validating Code

• http://validator.w3.org/mobile/

Page 10: Coding for Mobile Week 13 TCNJ Web 2 Jean Chu. Web is Dead. Long live the Internet

Simulators

• iphone – http://testiphone.com/

• Blackberry– http://us.blackberry.com/developers/resources/si

mulators.jsp

• Android– http://developer.android.com/sdk/index.html

Page 11: Coding for Mobile Week 13 TCNJ Web 2 Jean Chu. Web is Dead. Long live the Internet

BUILD MOBILE WEB / APP USING JQUERY MOBILE

Using jQuery Mobile (alpha version yet)

Page 12: Coding for Mobile Week 13 TCNJ Web 2 Jean Chu. Web is Dead. Long live the Internet

jQuery Mobile

• It is Alpha Version so far (Not even Beta)– http://jquerymobile.com/– http://jquerymobile.com/demos/1.1.0/

• HTML5 markup-driven • Supports Mobile only events (Tap, Swipe, etc)