59
Mobile Apps with PhoneGap and jQuery Mobile Terry Ryan Worldwide Developer Evangelist @tpryan

Mobile Apps with PhoneGap and jQuery Mobile

Embed Size (px)

DESCRIPTION

The Codeworks presentation on mobile front ends including PhoneGap, jQuery Mobile, CSS Shaders and Proto.

Citation preview

Page 1: Mobile Apps with PhoneGap and jQuery Mobile

Mobile Apps with PhoneGap and jQuery MobileTerry Ryan Worldwide Developer Evangelist@tpryan

Page 2: Mobile Apps with PhoneGap and jQuery Mobile

Who Are You?

Page 3: Mobile Apps with PhoneGap and jQuery Mobile
Page 4: Mobile Apps with PhoneGap and jQuery Mobile
Page 5: Mobile Apps with PhoneGap and jQuery Mobile
Page 6: Mobile Apps with PhoneGap and jQuery Mobile

Why jQuery Mobile?

Page 7: Mobile Apps with PhoneGap and jQuery Mobile

Fixed position toolbar

Expand <a> to fill entire <li> space for touchability

Fixed position toolbar that doesn’t work in Android, yet

Replace default link following with Ajax call and replacing <body>

Add margins to list to make work with toolbars

Also it doesn’t display right.

Doesn’t work on all mobile browsers

Page 8: Mobile Apps with PhoneGap and jQuery Mobile

Doing it yourself sucks.

Page 9: Mobile Apps with PhoneGap and jQuery Mobile

Especially if someone else

has done it

Page 10: Mobile Apps with PhoneGap and jQuery Mobile

<div data-role=“header”>

<div data-role=“footer”>

<ul data-role="listview”>

<a> No AJAX required

Entire app is one HTML document

Works perfectly in many browsers, gracefully degrades in most.

Page 11: Mobile Apps with PhoneGap and jQuery Mobile

jQuery makes stuff easy

Page 12: Mobile Apps with PhoneGap and jQuery Mobile

jQuery has a huge

ecosystem

Page 13: Mobile Apps with PhoneGap and jQuery Mobile

GETTING STARTED WITH JQUERY MOBILE

Page 14: Mobile Apps with PhoneGap and jQuery Mobile

<!DOCTYPE html> <html> <head> <title>Codeworks</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="jquery.mobile-1.0.min.css" /><script type="text/javascript" src="jquery-1.6.4.min.js"></script><script type="text/javascript" src="jquery.mobile-1.0.min.js"></script></head>

Basic Page Start

Page 15: Mobile Apps with PhoneGap and jQuery Mobile

Page Model

Page 16: Mobile Apps with PhoneGap and jQuery Mobile

<div data-role="page" id="landing" ><div data-role="header">

<!-- header content --></div><div data-role="content">

<!-- Page content --></div><div data-role="footer" >

<!-- Footer content --></div>

</div>

Basic Page Layout

Page 17: Mobile Apps with PhoneGap and jQuery Mobile

<div data-role="page" id="landing"><!-- page content -->

</div>

<div data-role="page" id="detail"><!-- page content -->

</div>

<div data-role="page" id="map"><!-- page content -->

</div>

Basic Page Layout

Page 18: Mobile Apps with PhoneGap and jQuery Mobile

<a href="#map" class="ui-btn-active">Map</a>

Navigation

Page 19: Mobile Apps with PhoneGap and jQuery Mobile

<div data-role="page" id="second" data-add-back-btn="true">

Navigation

Page 20: Mobile Apps with PhoneGap and jQuery Mobile

<ul data-role="listview"><li><a href="#second">Second</a></li><li><a href="#third">Third</a></li>

</ul>

Data Lists

Page 21: Mobile Apps with PhoneGap and jQuery Mobile

<div data-role="navbar"><ul><li><a href="#landing" class="ui-btn-active">Schedule</a></li><li><a href="#map">Map</a></li></ul></div>

Tab Menus

Page 22: Mobile Apps with PhoneGap and jQuery Mobile

<form > <label for="username">Username:</label> <input type="text" name="username" id="username" /> <label for="password">Password:</label> <input type="password" name="password" id="password" /> <input type="submit" name="submit" value="Login" /></form>

Forms

Page 23: Mobile Apps with PhoneGap and jQuery Mobile

THEME ROLLER

Page 24: Mobile Apps with PhoneGap and jQuery Mobile

I want my own design

Page 25: Mobile Apps with PhoneGap and jQuery Mobile
Page 26: Mobile Apps with PhoneGap and jQuery Mobile

• Download jQuery Mobile– http://jquerymobile.com/

• Check out killer documentation– http://jquerymobile.com/demos/1.0/

• Check out Theme Roller– http://jquerymobile.com/themeroller/

Next Steps with jQuery Mobile

Page 27: Mobile Apps with PhoneGap and jQuery Mobile
Page 28: Mobile Apps with PhoneGap and jQuery Mobile

We have a web app

We need a native app

Page 29: Mobile Apps with PhoneGap and jQuery Mobile

Why do we need native?

Page 30: Mobile Apps with PhoneGap and jQuery Mobile

CameraCompass

Accelerometer

Page 31: Mobile Apps with PhoneGap and jQuery Mobile

The ease of web

the access of native

Page 32: Mobile Apps with PhoneGap and jQuery Mobile

Enter PhoneGap

Page 33: Mobile Apps with PhoneGap and jQuery Mobile

PhoneGap packages a

web app into a “native” app

Page 34: Mobile Apps with PhoneGap and jQuery Mobile

What do you mean by

“native” apps

Page 35: Mobile Apps with PhoneGap and jQuery Mobile

Apps can be distributed in

stores

Page 36: Mobile Apps with PhoneGap and jQuery Mobile

UI is not native

Page 37: Mobile Apps with PhoneGap and jQuery Mobile

PHONEGAP BUILD

Page 38: Mobile Apps with PhoneGap and jQuery Mobile

One pain point: Lots of

software

Page 39: Mobile Apps with PhoneGap and jQuery Mobile
Page 40: Mobile Apps with PhoneGap and jQuery Mobile
Page 41: Mobile Apps with PhoneGap and jQuery Mobile

Enter PhoneGap

Build

Page 42: Mobile Apps with PhoneGap and jQuery Mobile

• Setup build– Certificates– Provision files

• Get code to cloud– Upload– Link to git repository

• Have servers build app files

PhoneGap Build

Page 43: Mobile Apps with PhoneGap and jQuery Mobile

Demo

PhoneGap Build

Page 44: Mobile Apps with PhoneGap and jQuery Mobile

• Look at Phone Gap– http://phonegap.com/

• Get started – http://phonegap.com/start

• Phone Gap Build– https://build.phonegap.com/

Next Steps with Phone Gap

Page 45: Mobile Apps with PhoneGap and jQuery Mobile

ADOBE SNEAKSCSS Shaders and Proto

Page 46: Mobile Apps with PhoneGap and jQuery Mobile
Page 47: Mobile Apps with PhoneGap and jQuery Mobile

What if browsers could do more?

Page 48: Mobile Apps with PhoneGap and jQuery Mobile

Enter CSS Shaders

Page 49: Mobile Apps with PhoneGap and jQuery Mobile

Cinematic effects for the

web

Page 50: Mobile Apps with PhoneGap and jQuery Mobile

Demo

CSS Shaders

Page 51: Mobile Apps with PhoneGap and jQuery Mobile

Tablets are just about

consumption

Page 52: Mobile Apps with PhoneGap and jQuery Mobile

Enter Adobe Proto

Page 53: Mobile Apps with PhoneGap and jQuery Mobile

Proto is an whiteboarding app for tablets that output to

HTML

Page 54: Mobile Apps with PhoneGap and jQuery Mobile

Demo

Proto

Page 55: Mobile Apps with PhoneGap and jQuery Mobile

• More About CSS Shaders– http://www.adobe.com/devnet/html5/

articles/css-shaders.html

• More about Proto– http://www.adobe.com/products/

proto.html

Next Steps with Adobe

Page 56: Mobile Apps with PhoneGap and jQuery Mobile

CONCLUSIONS

Page 57: Mobile Apps with PhoneGap and jQuery Mobile

Timeout

Page 58: Mobile Apps with PhoneGap and jQuery Mobile

Apps people have to use

Apps people love to use

Page 59: Mobile Apps with PhoneGap and jQuery Mobile

Follow up?

• Feel free to contact me– [email protected]– http://terrenceryan.com– Twitter: @tpryan