Cross-Platform Mobile Apps with HTML, JavaScript, and PhoneGap - - PowerPoint PPT Presentation

cross platform mobile apps with html javascript and
SMART_READER_LITE
LIVE PREVIEW

Cross-Platform Mobile Apps with HTML, JavaScript, and PhoneGap - - PowerPoint PPT Presentation

Cross-Platform Mobile Apps with HTML, JavaScript, and PhoneGap Christophe Coenraets @ccoenraets Resources @ccoenraets http://coenraets.org http://github.com/ccoenraets ccoenrae@adobe.com What? 3 Mobile Application Development Challenge +


slide-1
SLIDE 1

Cross-Platform Mobile Apps with HTML, JavaScript, and PhoneGap

Christophe Coenraets @ccoenraets

slide-2
SLIDE 2

Resources

@ccoenraets http://coenraets.org http://github.com/ccoenraets ccoenrae@adobe.com

slide-3
SLIDE 3

What?

3

slide-4
SLIDE 4

Mobile Application Development Challenge

4

Samsung Bada Windows Phone BlackBerry Mobile BlackBerry QNX Android Apple iOS Nokia

Objective-C Java NDK ActionScript J2ME C# C++ C++

+ +

slide-5
SLIDE 5

The “Gap”

§ Package HTML/JS/CSS assets as Native

Application

§ Expose device capabilities as JavaScript APIs

consistent across platforms

5

slide-6
SLIDE 6

The “Gap”

§ PhoneGap is a “wrapper” and a “bridge” § PhoneGap is NOT:

§ A full-stack JavaScript framework § An architectural framework § A UI framework

6

slide-7
SLIDE 7

PhoneGap works with any Framework

7

slide-8
SLIDE 8

Access to Device Features

8

http://phonegap.com/about/features

slide-9
SLIDE 9

What if you need more?

§ PhoneGap is extensible with Plugins model that enables you to write your own

native logic to access via JavaScript

§ All phonegap APIs are plugins § There are lots of open source plugins at

https://github.com/phonegap/phonegap-plugins

9

slide-10
SLIDE 10

10

DEMO: What does a PhoneGap app look like?

slide-11
SLIDE 11

Open Source

11

§ PhoneGap/Cordova was contributed to Apache by Adobe § You can get involved today!

http://incubator.apache.org/cordova/

slide-12
SLIDE 12

build.phonegap.com

§ Continuous deployment § No SDK required § GitHub compatible § Remote debugging

slide-13
SLIDE 13

Debugging with Weinre

slide-14
SLIDE 14

How?

14

slide-15
SLIDE 15

Before

slide-16
SLIDE 16

After: “Single Page App”

<html> <head> <title>My Huge App</title> <script src="my-huge-app.js"></script> </head> </body><body> </html>

slide-17
SLIDE 17

Characteristics of a Single Page App

§ Views are built dynamically § Templates to the rescue § History handled by # or push state § Data obtained through RESTful JSON, JSONP services § Structure / Patterns needed to handle complexity

17

slide-18
SLIDE 18

Choosing a stack

18

DOM Architecture U I

slide-19
SLIDE 19

Example: Backbone Directory

19

http://github.com/ccoenraets/backbone-directory

slide-20
SLIDE 20

Backbone.js Routing

20

slide-21
SLIDE 21

Backbone.js Models and REST

21

slide-22
SLIDE 22

Employee Directory RESTful API

HTTP Method URL GET api/employees GET api/employees/1 GET api/employees/1/reports POST api/employees PUT api/employees/1 DELETE api/employees/1

22

slide-23
SLIDE 23

Backbone.js Views

23

slide-24
SLIDE 24

Templates: Before

24

slide-25
SLIDE 25

Templates: After

§ Check out Mustache.js, Underscore.js, Handlebar.js, etc

25

slide-26
SLIDE 26

Resources

@ccoenraets http://coenraets.org http://github.com/ccoenraets ccoenrae@adobe.com