• Save
Cross-platform App with PhoneGap - Henri Mägi
Upcoming SlideShare
Loading in...5
×
 

Cross-platform App with PhoneGap - Henri Mägi

on

  • 1,361 views

Henri Mägi - Mobile Software Engineer @ Mooncascade

Henri Mägi - Mobile Software Engineer @ Mooncascade

Statistics

Views

Total Views
1,361
Views on SlideShare
645
Embed Views
716

Actions

Likes
0
Downloads
0
Comments
0

6 Embeds 716

http://www.momoestonia.com 704
http://translate.googleusercontent.com 5
http://4794502522158602920_5cff2862ab2a1afbf0557f6e7ea1b514f012d562.blogspot.com 4
http://www.feedly.com 1
http://cloud.feedly.com 1
http://repullulescent16.rssing.com 1

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Cross-platform App with PhoneGap - Henri Mägi Cross-platform App with PhoneGap - Henri Mägi Presentation Transcript

  • CROSS-PLATFORM APP WITHPHONEGAPHenri Mägi
  • HISTORY• 2008 at an iPhoneDevCamp event in San Francisco• Adobe officially announced the acquisition of Nitobi Software(the original developer) on October 4, 2011• Coincident with that, the PhoneGap code was contributed tothe Apache Software Foundation to start a new project calledApache Cordova.
  • WHAT IS PHONEGAP?Wrap it withPhoneGapDeploy to mobileplatforms
  • PLATFORMS• iOS• Android• Blackberry• WebOS• Windows Phone 7+8• Symbian• Bada
  • FEATURES• Accelerometer• Camera• Compass• Contacts• File• Geolocation• Media• Network• Notifications• Storage
  • SAMPLE CODE SNIPPET• Platform specific config.xmlin IOS: <plugin name="Accelerometer" value="CDVAccelerometer" />• Javascript:function onSuccess(acceleration) {alert(Acceleration X: + acceleration.x + n +Acceleration Y: + acceleration.y + n +Acceleration Z: + acceleration.z + n +Timestamp:      + acceleration.timestamp + n);};function onError() {alert(onError!);};navigator.accelerometer.getCurrentAcceleration(onSuccess, onError);
  • CUSTOM PLUGINS• Javascript:exec(<successFunction>, <failFunction>, <service>, <action>, [<args>]);• Platform specific xml config<plugin name="service_name" value="PluginClassName" />• iOS:(void)myMethod:(CDVInvokedUrlCommand*)command{CDVPluginResult* pluginResult = nil;NSString* myarg = [command.arguments objectAtIndex:0];if (myarg != nil) {pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];} else {pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERRORmessageAsString:@"Arg was null"];}[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];}
  • APP’S USING PHONEGAP
  • TINYTERRORS
  • WHENTO USE?• Multiple Platforms• Access basic native functionality• Offline usage• Not proficient in target platform• Simple apps
  • WHEN NOT?• Data Processing• Background Processing• Access advanced native functionality• Complex Business Logic• Advanced Graphics
  • THANKYOU!• Special thanks goes to Priit Salumaa• Mooncascade• Fortumo• Department of Business Development atTartu CityGovernment• Questions??