Intro to PhoneGap and PhoneGap Build

63
@ChrisGriffith

description

See how PhoneGap (Apache Cordova), an open-source framework, and the Adobe PhoneGap Build service, part of the Adobe Creative Cloud, allow you to create cross-platform mobile apps using the web technologies you know and love: HTML, CSS, and JavaScript. Learn how PhoneGap works and how it will enable you to start building mobile apps with web standards. This talk will introduce you to the PhoneGap API and walk you through how to interact with the JavaScript methods to create interactive, feature-rich mobile applications. You will also get an introduction to PhoneGap Build which allows you to package mobile apps in the cloud. This session will cover: Getting started with the PhoneGap API Interacting with the native device features (camera, video) Accessing and using the geolocation sensors Compiling the application using PhoneGap Build

Transcript of Intro to PhoneGap and PhoneGap Build

Page 1: Intro to PhoneGap and PhoneGap Build

@ChrisGriffith

Page 2: Intro to PhoneGap and PhoneGap Build

These opinions and thoughts are my own, and may or may not reflect the opinions of the company that I work for.

Disclaimer

Page 3: Intro to PhoneGap and PhoneGap Build
Page 4: Intro to PhoneGap and PhoneGap Build
Page 5: Intro to PhoneGap and PhoneGap Build
Page 6: Intro to PhoneGap and PhoneGap Build
Page 7: Intro to PhoneGap and PhoneGap Build

Who has built for mobile?

Page 8: Intro to PhoneGap and PhoneGap Build

Who is developing for iOS?

Page 9: Intro to PhoneGap and PhoneGap Build

Who is developing for Android?

Page 10: Intro to PhoneGap and PhoneGap Build

I need to make a mobile app…

Page 11: Intro to PhoneGap and PhoneGap Build
Page 12: Intro to PhoneGap and PhoneGap Build
Page 13: Intro to PhoneGap and PhoneGap Build

Objective C Android Flavored Java

C# XAML

Page 14: Intro to PhoneGap and PhoneGap Build

Objective C Android Flavored Java

C# XAML

Page 15: Intro to PhoneGap and PhoneGap Build
Page 16: Intro to PhoneGap and PhoneGap Build

PhoneGap

Page 17: Intro to PhoneGap and PhoneGap Build

Genesis

Page 18: Intro to PhoneGap and PhoneGap Build

Getting Started

cordova.apache.org

Page 19: Intro to PhoneGap and PhoneGap Build

But who really uses HTML in their app?

Page 20: Intro to PhoneGap and PhoneGap Build
Page 21: Intro to PhoneGap and PhoneGap Build
Page 22: Intro to PhoneGap and PhoneGap Build
Page 23: Intro to PhoneGap and PhoneGap Build
Page 24: Intro to PhoneGap and PhoneGap Build
Page 25: Intro to PhoneGap and PhoneGap Build
Page 26: Intro to PhoneGap and PhoneGap Build
Page 27: Intro to PhoneGap and PhoneGap Build

Application container that allows you to build natively installed apps using HTML, CSS & JavaScript

What is PhoneGap?

Page 28: Intro to PhoneGap and PhoneGap Build

What is PhoneGap?

Your Code

Page 29: Intro to PhoneGap and PhoneGap Build

What is PhoneGap?

Your Code

Native Web View

Page 30: Intro to PhoneGap and PhoneGap Build

What is PhoneGap?

Your Code

Native Web View

Native APIs

Page 31: Intro to PhoneGap and PhoneGap Build

What is PhoneGap?

Your Code

Native Web View

Native APIs

Native App - .apk, .ipa, etc

Page 32: Intro to PhoneGap and PhoneGap Build

What platforms support PhoneGap?

Page 33: Intro to PhoneGap and PhoneGap Build

Since it is HTML, CSS & JSS, can I use existing tools/frameworks?

Page 34: Intro to PhoneGap and PhoneGap Build

Caution…

PhoneGap uses the NATIVE browser on the device to render the HTML/CSS/JS

Keep that in mind, as that can affect the experience

Page 35: Intro to PhoneGap and PhoneGap Build

Device Access

Page 36: Intro to PhoneGap and PhoneGap Build

Accelerometer - when the device movesCamera - pictures of your catCapture - audio, video, stills of your catCompass - for when you're lostConnection - type of connectionContacts - find and create new friends

Features

Page 37: Intro to PhoneGap and PhoneGap Build

Device - device and OS version metadataEvents - various app/hardware related eventsFile - native file system access (+ upload)Geolocation - for when you're lostGlobalization - date/number/currency formatting

Features

Page 38: Intro to PhoneGap and PhoneGap Build

Media - related to audio playback (supports record as well)Notification - visual, audible, and tactile notificationsSplashscreen - for your splash screen needsStorage - Mini database

Features

Page 39: Intro to PhoneGap and PhoneGap Build

PhoneGap 3.0

Page 40: Intro to PhoneGap and PhoneGap Build

Beyond the mobile web

PhoneGap is extensible with a “native plugin” model that enables you to write your own native logic to access via JavaScript.

There are lots of open source plugins at https://github.com/phonegap/phonegap-plugins

Learn more at http://wiki.phonegap.com/w/page/36752779/ PhoneGap%20Plugins

Page 41: Intro to PhoneGap and PhoneGap Build

PhoneGap Community (some…)

Page 42: Intro to PhoneGap and PhoneGap Build

Building it

phonegap.com/start

Page 43: Intro to PhoneGap and PhoneGap Build

Command Line Interface

docs.phonegap.com/en/3.0.0/guide_cli_index.md.html

Page 44: Intro to PhoneGap and PhoneGap Build

Building it

build.phonegap.com

Page 45: Intro to PhoneGap and PhoneGap Build
Page 46: Intro to PhoneGap and PhoneGap Build
Page 47: Intro to PhoneGap and PhoneGap Build
Page 48: Intro to PhoneGap and PhoneGap Build

<?xml version="1.0" encoding="UTF-8"?><widget xmlns = "http://www.w3.org/ns/widgets"

xmlns:gap = "http://phonegap.com/ns/1.0"id = "com.ajsoftware.demo.parkfinderhd"versionCode=""version = "1.0.1"><name>Park Finder HD</name><description>A demonstration of jQuery Mobile and PhoneGap Build</description><author href="http://www.aj-software.com" email="[email protected]">Chris

Griffith</author><preference name="phonegap-version" value="3.0.0" /><preference name="orientation" value="portrait" /><preference name="target-device" value="universal" /><preference name="fullscreen" value="true" /><preference name="webviewbounce" value="true" /><preference name="prerendered-icon" value="true" /><preference name="stay-in-webview" value="true" /><preference name="ios-statusbarstyle" value="black-opaque" /><preference name="detect-data-types" value="true" /><preference name="exit-on-suspend" value="true" /><preference name="show-splash-screen-spinner" value="true" /><preference name="auto-hide-splash-screen" value="true" /><preference name="disable-cursor" value="true" /><preference name="android-minSdkVersion" value="11" /><preference name="android-installLocation" value="auto" /><preference name="splash-screen-duration" value="5000" /><preference name="load-url-timeout" value="20000" />

Page 49: Intro to PhoneGap and PhoneGap Build

<gap:platform name="ios" /><gap:platform name="android" /><gap:platform name="winphone" /><feature name="http://api.phonegap.com/1.0/camera"/><feature name="http://api.phonegap.com/1.0/geolocation"/><feature name="http://api.phonegap.com/1.0/network"/><feature name="http://api.phonegap.com/1.0/notification"/><gap:plugin name="org.apache.cordova.core.media-capture" /><gap:plugin name="org.apache.cordova.core.camera" /><gap:plugin name="org.apache.cordova.core.geolocation" /><gap:plugin name="org.apache.cordova.core.device" /><gap:plugin name="org.apache.cordova.core.device-motion" /><gap:plugin name="org.apache.cordova.core.network-information" /><gap:plugin name="org.apache.cordova.core.dialogs" /><gap:plugin name="org.apache.cordova.core.globalization" /><gap:plugin name="org.apache.cordova.core.console" /><gap:plugin name="org.apache.cordova.core.audiohandler" /><gap:plugin name="org.apache.cordova.core.battery-status" /><gap:plugin name="org.apache.cordova.core.file" /><gap:plugin name="org.apache.cordova.core.device-orientation" /><gap:plugin name="org.apache.cordova.core.file-transfer" /><gap:plugin name="org.apache.cordova.core.splashscreen" /><gap:plugin name="org.apache.cordova.core.vibration" /><gap:plugin name="org.apache.cordova.core.inappbrowser" /><icon src="icons/icon_57.png" gap:platform="ios" width="57" height="57" /><icon src="icons/icon_72.png" gap:platform="ios" width="72" height="72" /><icon src="icons/icon_114.png" gap:platform="ios" width="114" height="114" />

Page 50: Intro to PhoneGap and PhoneGap Build

<icon src="icons/icon_144.png" gap:platform="ios" width="144" height="144" /><icon src="icons/icon_36.png" gap:platform="android" gap:density="ldpi" /><icon src="icons/icon_48.png" gap:platform="android" gap:density="mdpi" /><icon src="icons/icon_72.png" gap:platform="android" gap:density="hdpi" /><icon src="icons/icon_96.png" gap:platform="android" gap:density="xhdpi" /><icon src="icons/icon_48.png" gap:platform="winphone" /><icon src="icons/icon_62.png" gap:platform="winphone" gap:role="background" /><icon src="icons/icon_64.png" gap:platform="blackberry" /><icon src="icons/icon_64.png" gap:platform="webos" /><gap:splash src="splash/splash_320_480.png" gap:platform="ios" width="320"

height="480" /><gap:splash src="splash/splash_640_960.png" gap:platform="ios" width="640"

height="960" /><gap:splash src="splash/splash_320_480.png" gap:platform="android"

gap:density="mdpi" /><gap:splash src="splash/splash_480_800.png" gap:platform="android"

gap:density="hdpi" /><gap:splash src="splash/splash_800_1280.png" gap:platform="android"

gap:density="xhdpi" /><access origin="*.google.com" subdomains="true" />

</widget>

Page 51: Intro to PhoneGap and PhoneGap Build

ConfiGAP

configap.com

Page 52: Intro to PhoneGap and PhoneGap Build

Building it

<Demo />

Page 53: Intro to PhoneGap and PhoneGap Build

• Desktop Browser• Mobile via Web• Ripple Emulator• Local SDK to Simulator/Device

REAL WORLD BUILDING

Page 54: Intro to PhoneGap and PhoneGap Build

• Pro: Super Fast• Pro: No setup• Pro: Debugging Rocks

• Con: UI isn't right• Con: UX isn't right• Con: Features missing• Con: Security restrictions

DESKTOP BROWSER

Page 55: Intro to PhoneGap and PhoneGap Build

• Pro: Kinda Fast• Pro: Minimal setup• Pro: UI and UX testing

• Con: Features missing• Con: Security restrictions• Con: Debugging (kinda) sucks

MOBILE VIA WEB

Page 56: Intro to PhoneGap and PhoneGap Build

• Pro: Fast• Pro: Similar UI• Pro: Free• Pro: Security restrictions gone

• Con: Doesn't support 100% of the PhoneGap APIs

• Con: Still not on the device

RIPPLE EMULATOR

Page 57: Intro to PhoneGap and PhoneGap Build

• Go to the Chrome Web Store: https://chrome.google.com/webstore/category/home• Search for "ripple"• Click Extensions

TO INSTALL

Page 58: Intro to PhoneGap and PhoneGap Build
Page 59: Intro to PhoneGap and PhoneGap Build

• Pro: The Real Deal

• Con: Slow(ish)• Con: Not Free• Con: Debugging can suck

TO BE CLEAR: YOU MUST ALWAYS TEST ON A REAL DEVICE

LOCAL SDK TO SIMULATOR/DEVICE

Page 60: Intro to PhoneGap and PhoneGap Build

Hydration

Page 61: Intro to PhoneGap and PhoneGap Build
Page 62: Intro to PhoneGap and PhoneGap Build

Now go build something!

Page 63: Intro to PhoneGap and PhoneGap Build

Thanks!

[email protected]

@chrisgriffith

http://chrisgriffith.wordpress.com/