getting acquainted with phonegap

38
Getting Acquainted with PhoneGap NATIONAL ASSOCIATION OF GOVERNMENT WEB PROFESSIONALS – MARCH 6 2014

Upload: joseph-labrecque

Post on 09-May-2015

2.012 views

Category:

Technology


1 download

DESCRIPTION

An overview of developing mobile applications with HTML, CSS and JavaScript using PhoneGap, node.js, Brackets and related tools.

TRANSCRIPT

Page 1: Getting Acquainted with PhoneGap

Getting Acquainted

with PhoneGapNATIONAL ASSOCIATION OF GOVERNMENT WEB PROFESSIONALS – MARCH 6 2014

Page 2: Getting Acquainted with PhoneGap

Introduction

Mobile apps with Web Standards

Environment Configuration

Mobile Tooling

Mobile Frameworks

App Emulation

Release Builds

Deployment

Page 3: Getting Acquainted with PhoneGap

Joseph Labrecque

Senior Interactive Software Engineer | Adjunct FacultyUniversity of Denver

Proprietor | OwnerFractured Vision Media, LLC

Adobe Community ProfessionalAdobe Education LeaderAdobe Certified ExpertAdobe Certified EducatorAdobe Influencer

AuthorLynda.com | Peachpit Press | Adobe Press | Packt Publishing | O’Reilly Media | video2brain

ArtistAn Early Morning Letter, Displaced | shivervein

Page 4: Getting Acquainted with PhoneGap

Developing Mobile Apps

Lots of choices out there…

Native (Objective-C, Java)

Web (hosted like websites)

Hybrid (compiled/wrapped)

Compiled (Adobe AIR)

Wrapped (PhoneGap)

Page 5: Getting Acquainted with PhoneGap

Introducing PhoneGapMOBILE APPLICATIONS BUILT WITH WEB STANDARDS

Page 6: Getting Acquainted with PhoneGap

PhoneGap and Cordova

Hybrid apps which leverage Web

Standards

Command line API

Apache Cordova

(similar to Apache Flex in structure)

Adobe PhoneGap

(Adobe’s version of Cordova)

Page 7: Getting Acquainted with PhoneGap

HTML5, CSS, JavaScript

Use HTML and CSS for design and layout

Use JavaScript for functionality

PhoneGap is a wrapper

Basically an uber-WebView

Adds native capabilities

Page 8: Getting Acquainted with PhoneGap

Target Platforms

Google Android

Apple iOS

Blackberry OS

Blackberry 10

WebOS

Windows Phone

Symbian

Bada

Page 9: Getting Acquainted with PhoneGap

First StepsGETTING EVERYTHING READY

Page 10: Getting Acquainted with PhoneGap

Environment Setup

Node.js w/ NPM

PhoneGap

Ripple

Java JDK

Native SDK

ANT

Page 11: Getting Acquainted with PhoneGap

Node.js and NPM

PhoneGap is installed and run

locally from Node.js

NPM handles installation and

updates

Command line driven

Easy to automate

Page 12: Getting Acquainted with PhoneGap

PhoneGap Configuration

npm install -g phonegap

This will install the latest PhoneGap

build into your local system.

Pretty well automated.

This is also how you update PhoneGap

to a new version.

Page 13: Getting Acquainted with PhoneGap

Project Generation

phonegap create test-app

This is the command to create a basic

application within your local system in order

to begin development.

The project at this point contains no platform

specific code at all.

Page 14: Getting Acquainted with PhoneGap

Project Directory

cd test-app

Enter the app directory to begin

invoking app-specific

commands like build or emulate.

www is where the development

occurs!

Page 15: Getting Acquainted with PhoneGap

Developing a Mobile AppTOOLS AND FRAMEWORKS

Page 16: Getting Acquainted with PhoneGap

Developing with PhoneGap

Using native SDKs

Download additional tools

Configure tools

Configure dependencies

Lots of work, initially

Using plain web technology

Simply write HTML, CSS, and

JavaScript

Upload to PhoneGap Build to

compile and test

Page 17: Getting Acquainted with PhoneGap

Brackets

Code editor for HTML, CSS, and

JavaScript

Open source software

http://brackets.io/

Node.js is built in – no separate local

web server needed for testing!

Live view – see changes in the browser

as you make them.

Edge Code CC is based upon Brackets.

Page 18: Getting Acquainted with PhoneGap

Dreamweaver CC

Multiple styles of working; design,

develop, hybrid…

Split view with live WebKit

rendering allows for immediate

verification of edits

Phonegap Build integration

Backend support as well

Page 19: Getting Acquainted with PhoneGap

Edge Animate CC

DOM based HTML animation and

interactivity.

Fully responsive scaling of content

just like with Flash. Even images

and text!

Create rich content to include

within PhoneGap applications.

Page 20: Getting Acquainted with PhoneGap

Edge Reflow CC

Visually prototype responsive

web design.

Uses a system of breakpoints just

like CSS media queries.

Design your complete UI visually in Reflow – use it in your

PhoneGap app!

Page 21: Getting Acquainted with PhoneGap

Flash Professional CC

“Flash is Dead!” - false

More than 175,000 applications

using AIR 3.8 or greater.

Installed over 500 million times in

the second half of 2013.

Reach 11 times more people than

the best-selling hardware game

console!

Plus: publish to HTML5 Canvas and

integrate with PhoneGap :)

http://www.adobe.com/products/flashruntimes/statistics.html

Page 22: Getting Acquainted with PhoneGap

Mobile UI & Development Frameworks

jQuery Mobile

Twitter Bootstrap

TopCoat

Angular.js

Backbone.js

Sencha

And many more…

Page 23: Getting Acquainted with PhoneGap

Beyond Web StandardsTAKING YOUR APP TO THE NEXT LEVEL

Page 24: Getting Acquainted with PhoneGap

PhoneGap Features

Accelerometer

Camera

Compass

Contacts

File

Geolocation

Media

Network

Notification (Alert)

Notification (Sound)

Notification (Vibration)

Storage

Page 25: Getting Acquainted with PhoneGap

PhoneGap Plugins

phonegap plugin add org.apache.cordova.geolocation

BarcodeScanner

Facebook Connect

GAPlugin

StatusBar

Calendar

Bluetooth

PhoneDialer

Clipboard

100s more…

https://build.phonegap.com/plugins

Page 26: Getting Acquainted with PhoneGap

Testing, Debugging, Distribution!GETTING YOUR APP READY FOR PRIMETIME

Page 27: Getting Acquainted with PhoneGap

Emulating with Ripple

npm install -g ripple-emulator

Installs the Ripple device

emulator to your local system.

ripple emulate

Launches Chrome with Ripple

enabled for testing.

Be sure to build first!

Page 28: Getting Acquainted with PhoneGap

Emulating with Native SDKs

phonegap run android

If you have a native emulator running,

PhoneGap will detect it, install the app, and

launch it for testing.

You can also test upon a device which is

connected to your local machine in this way.

Page 29: Getting Acquainted with PhoneGap

Building a Release Locally

phonegap build android

Will build an app package based upon the

particular platform specified.

Android… in this case.

Do NOT edit files within “platforms”…

Page 30: Getting Acquainted with PhoneGap

Updating an App

phonegap platform update android

Will update the app to use a newer

version of PhoneGap.

Of course… you have to update

PhoneGap itself first!

Page 31: Getting Acquainted with PhoneGap

Using PhoneGap Build

/www/config.xml

Upload .zip

Link to Git repository

Hydration!

Page 32: Getting Acquainted with PhoneGap

ConfiGAP Utility

Create config.xml files easily

Used with PhoneGap Build

Create new config.xml files or

edit existing ones

Made with AIR/Flash – cross-

platform

http://configap.com/

Page 33: Getting Acquainted with PhoneGap

App Deployment and Publication

Take each properly signed

release build and upload to

the appropriate distribution point.

Every mobile app store is

different.

Page 34: Getting Acquainted with PhoneGap

Joseph’s Workflow…

1. Test using Brackets via www directory. No compile step!

2. Emulate via Ripple

3. Emulate via native tools

4. Debug on device

5. Use Hydration to test on multiple devices

6. Release build

7. Distribution

Page 35: Getting Acquainted with PhoneGap

Closing RemarksJUST A COUPLE MORE THINGS…

Page 36: Getting Acquainted with PhoneGap

Building a Mobile App with

Feathers and Starling Downloading the frameworks and

the AIR SDK

Configuring the project

Implementing a theme

Creating the screen classes

Adding a navbar component

Building the classes

Returning saved files

Publishing a project

Installing and running the app

http://www.lynda.com/JosephLabrecque

Page 37: Getting Acquainted with PhoneGap

Learning Adobe Edge Animate

Master the Edge Animate interface and unleash your

creativity through standard HTML, CSS, and JavaScript

Packed with an abundance of information regarding

the Edge Animate application and related toolsets

Robust motion and interactivity through web standards

Those approaching Edge Animate from Adobe Flash

Professional will find many references and tips for a

smooth transition

A comprehensive guide for creating engaging content

with Adobe Edge Animate.

http://www.amazon.com/Joseph-Labrecque/e/B0057R7UO0/

Page 38: Getting Acquainted with PhoneGap

Thanks. Questions?

CONTACT JOSEPH

@JosephLabrecque

JosephLabrecque.com

[email protected]