PhoneGapAndrew Lunny, Adobe
Monday, 23 July, 12
Me@alunny
Computer Scientist
PhoneGap Build
Nitobi Software
Adobe Systems
Author
Monday, 23 July, 12
Me
Apache Cordova
Mostly out of date
@alunny
Computer Scientist
PhoneGap Build
Nitobi Software
Adobe Systems
Author
Monday, 23 July, 12
PhoneGap Build
Six Platforms
No SDKs
No Problem
build.phonegap.com
Monday, 23 July, 12
PhoneGap Build
Six Platforms
No SDKs
No Problem
build.phonegap.com
(there are still many problems)
Monday, 23 July, 12
PhoneGap Build
Six Platforms
No SDKs
No Problem
build.phonegap.com
(there are still many problems)
BETA
Monday, 23 July, 12
What is PhoneGap?
Monday, 23 July, 12
cross-platformnativemobile appsusing HTML5
Monday, 23 July, 12
cross-platformnativemobile appsusing HTML5
Monday, 23 July, 12
cross-platformnativemobile appsusing HTML5
Monday, 23 July, 12
cross-platformnativemobile appsusing HTML5
‣ Objective-C
‣ Java‣ Android flavor
‣ BlackBerry flavor
‣ C#Monday, 23 July, 12
cross-platformnativemobile appsusing HTML5
Monday, 23 July, 12
Huh?
Monday, 23 July, 12
(native) webview(hybrid) bridge(web) JS APIs
Monday, 23 July, 12
(native) webviewpart of the SDK
Monday, 23 July, 12
this is goodreduces app size
eases devfits all terms
Monday, 23 July, 12
this is badmixed HTML5
mixed performanceannoying bugs
Monday, 23 July, 12
framework codemostly native
developer codemostly web
Monday, 23 July, 12
caveat
Monday, 23 July, 12
extra capabilitiesthrough pluginsusually requirenative + js
Monday, 23 July, 12
(hybrid) bridgeprovided by PG
Monday, 23 July, 12
importantstring passing
(has limitations)
Monday, 23 July, 12
the name
Monday, 23 July, 12
PhoneGap-> Callback-> Cordova-> PhoneGap
Monday, 23 July, 12
Confusion!
Monday, 23 July, 12
Apache Cordovacordova.iodistributed atphonegap.com
Monday, 23 July, 12
High-Level Goalsvs reality
Monday, 23 July, 12
the web is a firstclass developmentplatform
Monday, 23 July, 12
reality:APIs mostly thereUI still a question
Monday, 23 July, 12
the purpose ofPhoneGap is tocease to exist
Monday, 23 July, 12
reality:mobile browsersmove slowly
Monday, 23 July, 12
APIsdocs.phonegap.com
Monday, 23 July, 12
‣ events
‣ device
‣ connection
‣ notification
basics
Monday, 23 July, 12
$.on(‘deviceready’, function () { // comment startApp()})
events
Monday, 23 July, 12
$.on(‘resume’, function () { // comment backToWork()})
events
Monday, 23 July, 12
var platform = device.platform, cdv = device.cordova;
alert(cdv + ‘ ‘ + platform);
device
Monday, 23 July, 12
var c = navigator.network.connection.type;
if (c == Connection.NONE) { doOfflineStuff();}
connection
Monday, 23 July, 12
navigator.notification.alert( 'You are the winner!', alertDismissed, 'Game Over', 'Done');
notification
Monday, 23 July, 12
‣ accelerometer
‣ geolocation
‣ compass
sensors
Monday, 23 July, 12
geolocation
navigator.geolocation.getCurrentPosition( onSuccess, onError, { enableHighAccuracy: true });
Monday, 23 July, 12
accelerometer
navigator.accelerometer.getCurrentAcceleration( onSuccess, onError);
Monday, 23 July, 12
compass
navigator.compass.getCurrentHeading( onSuccess, onError, { filter: 5 });
Monday, 23 July, 12
‣ media
‣ file
‣ camera
‣ contacts
data
Monday, 23 July, 12
media
var song = new Media( ‘http://site.com/audio.mp3’);
song.play();
Monday, 23 July, 12
// not fit for slide// see docs.phonegap.com
file: read/write
Monday, 23 July, 12
new FileTransfer.upload( ‘/some/file/uri’, ‘http://site.com/upload’, onSuccess, onError, options);
file: transfer
Monday, 23 July, 12
navigator.camera.getPicture( onSuccess, onFail, { quality: 50, destinationType: Camera.DestinationType. FILE_URI });
camera: legacy
Monday, 23 July, 12
navigator.device.capture.captureVideo( onSuccess, onError, { limit: 2 });
capture
Monday, 23 July, 12
var opt = new ContactFindOptions();opt.filter = "Bob";
navigator.contacts.find( [“displayName”, “name”], onSuccess, onError, opt);
contacts
Monday, 23 July, 12
PhoneGap 2.0
Monday, 23 July, 12
‣ cordova-js
‣ new platforms
‣ embeddable
‣ CLI tooling
2.0: super high-level
Monday, 23 July, 12
cordova-jsconsistent jswell-tested
builds by itself!
Monday, 23 July, 12
new platformswindows phone 7
badasoon: firefox,
tizenMonday, 23 July, 12
embeddablecordova-webviewpart of your app
Monday, 23 July, 12
CLI toolingno more Xcode!
createbuild
debugMonday, 23 July, 12
Plugins
Monday, 23 July, 12
‣ cross-platform
‣ the same JS
‣ consistent native API
‣ declarative installation
‣ documentation
what wewant
Monday, 23 July, 12
what we have
Monday, 23 July, 12
Monday, 23 July, 12
work on the waypluginstall
cordova-plugin-specgithub.com/alunny
Monday, 23 July, 12
consistent APIas of 2.0
(hopefully)docs.phonegap.com
Monday, 23 July, 12
Criticisms
Monday, 23 July, 12
laggypoor performance
Monday, 23 July, 12
best practivesuse touchstartavoid jQuery
make small apps
Monday, 23 July, 12
clunkydeveloper exp.too many releases
Monday, 23 July, 12
we know!CLI tools in 2.0fixing releases
build.phonegap.com
Monday, 23 July, 12
inconsistentdocumentation
Monday, 23 July, 12
improvingdocs.phonegap.com
cordova.iono more callback!
Monday, 23 July, 12
Thanks!@alunny
Monday, 23 July, 12