0
http://phonegap.com    Emil VargaSoftware Engineer     @ IBM
Develop in HTML5/CSS3 + JavaScript                                     Deploy to multiple platforms
●   Free and Open Source      ●   Large community      ●   Plugins and tools      ●   JavaScript frameworksxui
Here be JavaScript and HTML   WebView   (browser)Native application   Glued with PhoneGap(Java, C++, C#..)                ...
Technical details    ahead
●   Eclipse Classic 3.4 – 3.7.x (current)    http://www.eclipse.org/downloads/●   Download Android SDK, extract zip/tar,  ...
●   Download PhoneGap 1.4.1 (currently)●   Eclipse -> New -> Android Project    ●   Select your build target (e.g. Android...
//on application start wait for phonegap to fully loaddocument.addEventListener(“deviceReady”, function(){    //pop up a c...
Thanks to the PhoneGap teamAnd Brian LeRoux
Extra●   Plugins    https://github.com/purplecabbage/phonegap-plugins●   Cool Tools    ●   Lawnchair – simple NoSQL JSON  ...
DIY plugins//myPlugin.jsfunction MyPlugin() {};MyPlugin.prototype.myAction =function(params, winCallback, failCallback){  ...
DIY pluginsimport com.phonegap.api.Plugin;import com.phonegap.api.PluginResult;import org.json.JSONArray;import org.json.J...
PhoneGap
PhoneGap
Upcoming SlideShare
Loading in...5
×

PhoneGap

2,444

Published on

A quick jump into PhoneGap technology with a few tips.

Published in: Technology
0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,444
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
52
Comments
0
Likes
5
Embeds 0
No embeds

No notes for slide

Transcript of "PhoneGap"

  1. 1. http://phonegap.com Emil VargaSoftware Engineer @ IBM
  2. 2. Develop in HTML5/CSS3 + JavaScript Deploy to multiple platforms
  3. 3. ● Free and Open Source ● Large community ● Plugins and tools ● JavaScript frameworksxui
  4. 4. Here be JavaScript and HTML WebView (browser)Native application Glued with PhoneGap(Java, C++, C#..) Extra stuff (Barcode scanner, plug-ins Speech recognizer, Soft keyboard etc.)
  5. 5. Technical details ahead
  6. 6. ● Eclipse Classic 3.4 – 3.7.x (current) http://www.eclipse.org/downloads/● Download Android SDK, extract zip/tar, run ./android, select all, install http://developer.android.com/sdk/index.html● Install Eclipse plugin (Help->Install New Software..) https://dl-ssl.google.com/android/eclipse/ http://phonegap.com/start#android
  7. 7. ● Download PhoneGap 1.4.1 (currently)● Eclipse -> New -> Android Project ● Select your build target (e.g. Android 2.2) ● Add your package name ● Un-check creating SampleActivity.java● Copy content of the phonegap sample project <extracted folder>/lib/android/example to the new Android Project (everything except project.properties) ● Configure Build path -> Add JARs -> libs/phonegap-1.4.1.jar ● Edit AndroidManifest.xml – remove line android:xLargeScreens =”true” – Change <uses-sdk android:minSdkVersion=”5” /> to your build target (e.g. 8)
  8. 8. //on application start wait for phonegap to fully loaddocument.addEventListener(“deviceReady”, function(){ //pop up a confirmation dialog navigator.notification.confirm(“Do you want to exit?”, //function called on any button pressed (Yes or No) function(button){ //user pressed Yes if (button==1){ //exit application navigator.app.exitApp(); } },”Confirm”, “Yes,No”);},true);
  9. 9. Thanks to the PhoneGap teamAnd Brian LeRoux
  10. 10. Extra● Plugins https://github.com/purplecabbage/phonegap-plugins● Cool Tools ● Lawnchair – simple NoSQL JSON http://westcoastlogic.com/lawnchair/ ● ApplicationCraft – zero install developer envoronment http://www.applicationcraft.com/ ● Ripple – in-browser device emulator http://ripple.tinyhippos.com/ ● PhoneGap build https://build.phonegap.com/
  11. 11. DIY plugins//myPlugin.jsfunction MyPlugin() {};MyPlugin.prototype.myAction =function(params, winCallback, failCallback){ PhoneGap.exec(winCallback, failCallback, “MyPlugin”, “myAction”, [params]);}PhoneGap.addConstructor(function(){ PhoneGap.addPlugin(“myPlugin”, new MyPlugin());});
  12. 12. DIY pluginsimport com.phonegap.api.Plugin;import com.phonegap.api.PluginResult;import org.json.JSONArray;import org.json.JSONObject;public class MyPlugin extends Plugin{ public PluginResult execute(String action, JSONArray args, String callbackId){ if (action.equals(“myAction”)){ JSONObject obj = args.getJSONObject(args); ... return new PluginResult(PluginResult.Status.OK); } else return new PluginResult(PluginResult.Status.INVALID_ACTION); }}
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×