SlideShare ist ein Scribd-Unternehmen logo
1 von 14
Downloaden Sie, um offline zu lesen
http://phonegap.com


    Emil Varga
Software Engineer
     @ IBM
Develop in HTML5/CSS3 + JavaScript




                                     Deploy to multiple platforms
●   Free and Open Source
      ●   Large community
      ●   Plugins and tools
      ●   JavaScript frameworks


xui
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.)
Technical details
    ahead
●   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
●   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)
//on application start wait for phonegap to fully load
document.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);
Thanks to the PhoneGap team
And Brian LeRoux
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/
DIY plugins
//myPlugin.js

function MyPlugin() {};
MyPlugin.prototype.myAction =
function(params, winCallback, failCallback){
      PhoneGap.exec(winCallback, failCallback, “MyPlugin”,
      “myAction”, [params]);
}
PhoneGap.addConstructor(function(){
    PhoneGap.addPlugin(“myPlugin”, new MyPlugin());
});
DIY plugins
import 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);
    }
}

Weitere ähnliche Inhalte

Was ist angesagt?

MDC2011 Android_ Webdriver Automation Test
MDC2011 Android_ Webdriver Automation TestMDC2011 Android_ Webdriver Automation Test
MDC2011 Android_ Webdriver Automation Test
Masud Parvez
 
OpenLayers 3 & Google Closure Compiler
OpenLayers 3 & Google Closure CompilerOpenLayers 3 & Google Closure Compiler
OpenLayers 3 & Google Closure Compiler
Camptocamp
 

Was ist angesagt? (20)

Effective Android Development. UA Mobile 2016.
Effective Android Development. UA Mobile 2016.Effective Android Development. UA Mobile 2016.
Effective Android Development. UA Mobile 2016.
 
Behaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & DrupalBehaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & Drupal
 
DMCA #25: Jenkins - Docker & Android: Comment Docker peu faciliter la créatio...
DMCA #25: Jenkins - Docker & Android: Comment Docker peu faciliter la créatio...DMCA #25: Jenkins - Docker & Android: Comment Docker peu faciliter la créatio...
DMCA #25: Jenkins - Docker & Android: Comment Docker peu faciliter la créatio...
 
Fastlane - Automation and Continuous Delivery for iOS Apps
Fastlane - Automation and Continuous Delivery for iOS AppsFastlane - Automation and Continuous Delivery for iOS Apps
Fastlane - Automation and Continuous Delivery for iOS Apps
 
‘Hello, world!’ application how to dockerize golang application
‘Hello, world!’ application how to dockerize golang application‘Hello, world!’ application how to dockerize golang application
‘Hello, world!’ application how to dockerize golang application
 
Porting golang development environment developed with golang
Porting golang development environment developed with golangPorting golang development environment developed with golang
Porting golang development environment developed with golang
 
How to build rock solid apps & keep 100m+ users happy
How to build rock solid apps & keep 100m+ users happyHow to build rock solid apps & keep 100m+ users happy
How to build rock solid apps & keep 100m+ users happy
 
Eclipse RCP Demo
Eclipse RCP DemoEclipse RCP Demo
Eclipse RCP Demo
 
Visual Studio App Center: React Native A/B Testing
Visual Studio App Center: React Native A/B TestingVisual Studio App Center: React Native A/B Testing
Visual Studio App Center: React Native A/B Testing
 
Node.js Everywhere by @zwigby
Node.js Everywhere by @zwigbyNode.js Everywhere by @zwigby
Node.js Everywhere by @zwigby
 
Cocoa pods
Cocoa podsCocoa pods
Cocoa pods
 
iOS Indie Developer Toolkit - CocoaHeads 3city
iOS Indie Developer Toolkit - CocoaHeads 3cityiOS Indie Developer Toolkit - CocoaHeads 3city
iOS Indie Developer Toolkit - CocoaHeads 3city
 
MDC2011 Android_ Webdriver Automation Test
MDC2011 Android_ Webdriver Automation TestMDC2011 Android_ Webdriver Automation Test
MDC2011 Android_ Webdriver Automation Test
 
Insights on Protractor testing
Insights on Protractor testingInsights on Protractor testing
Insights on Protractor testing
 
Django Deployer
Django DeployerDjango Deployer
Django Deployer
 
Introduction to phone gap
Introduction to phone gapIntroduction to phone gap
Introduction to phone gap
 
OpenLayers 3 & Google Closure Compiler
OpenLayers 3 & Google Closure CompilerOpenLayers 3 & Google Closure Compiler
OpenLayers 3 & Google Closure Compiler
 
Fastlane
FastlaneFastlane
Fastlane
 
Instrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con GitlabInstrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con Gitlab
 
Front matter: Next Level Front End Deployments on OpenShift
Front matter: Next Level Front End Deployments on OpenShiftFront matter: Next Level Front End Deployments on OpenShift
Front matter: Next Level Front End Deployments on OpenShift
 

Ähnlich wie PhoneGap

EclipseCon Europe 2012 Tabris Workshop
EclipseCon Europe 2012 Tabris WorkshopEclipseCon Europe 2012 Tabris Workshop
EclipseCon Europe 2012 Tabris Workshop
Holger Staudacher
 
I phone app develoment ppt
I phone app develoment   pptI phone app develoment   ppt
I phone app develoment ppt
sagaroceanic11
 
I phone app develoment ppt
I phone app develoment   pptI phone app develoment   ppt
I phone app develoment ppt
sagaroceanic11
 

Ähnlich wie PhoneGap (20)

PhoneGap JavaScript API vs Native Components
PhoneGap JavaScript API vs Native ComponentsPhoneGap JavaScript API vs Native Components
PhoneGap JavaScript API vs Native Components
 
Phone gap development, testing, and debugging
Phone gap development, testing, and debuggingPhone gap development, testing, and debugging
Phone gap development, testing, and debugging
 
Phone gap 12 things you should know
Phone gap 12 things you should knowPhone gap 12 things you should know
Phone gap 12 things you should know
 
Introduction to PhoneGap
Introduction to PhoneGapIntroduction to PhoneGap
Introduction to PhoneGap
 
Intro to PhoneGap
Intro to PhoneGapIntro to PhoneGap
Intro to PhoneGap
 
Ionic2 - the raise of web developer, Riviera DEV le 17/06/2016
Ionic2 - the raise of web developer, Riviera DEV le 17/06/2016Ionic2 - the raise of web developer, Riviera DEV le 17/06/2016
Ionic2 - the raise of web developer, Riviera DEV le 17/06/2016
 
Introduction phonegap
Introduction phonegapIntroduction phonegap
Introduction phonegap
 
Advanced programing in phonegap
Advanced programing in phonegapAdvanced programing in phonegap
Advanced programing in phonegap
 
Intro to PhoneGap
Intro to PhoneGapIntro to PhoneGap
Intro to PhoneGap
 
Phonegap Development & Debugging
Phonegap Development & DebuggingPhonegap Development & Debugging
Phonegap Development & Debugging
 
Phone Gap
Phone GapPhone Gap
Phone Gap
 
phonegap with angular js for freshers
phonegap with angular js for freshers    phonegap with angular js for freshers
phonegap with angular js for freshers
 
So you want to Develop on Android....
So you want to Develop on Android....So you want to Develop on Android....
So you want to Develop on Android....
 
EclipseCon Europe 2012 Tabris Workshop
EclipseCon Europe 2012 Tabris WorkshopEclipseCon Europe 2012 Tabris Workshop
EclipseCon Europe 2012 Tabris Workshop
 
Developing advanced universal apps using html & js
Developing advanced universal apps using html & jsDeveloping advanced universal apps using html & js
Developing advanced universal apps using html & js
 
Android UI Testing with Appium
Android UI Testing with AppiumAndroid UI Testing with Appium
Android UI Testing with Appium
 
I phone app develoment ppt
I phone app develoment   pptI phone app develoment   ppt
I phone app develoment ppt
 
I phone app develoment ppt
I phone app develoment   pptI phone app develoment   ppt
I phone app develoment ppt
 
Cross Platform Mobile App Development
Cross Platform Mobile App DevelopmentCross Platform Mobile App Development
Cross Platform Mobile App Development
 
Flutter vs Java Graphical User Interface Frameworks - text
Flutter vs Java Graphical User Interface Frameworks - textFlutter vs Java Graphical User Interface Frameworks - text
Flutter vs Java Graphical User Interface Frameworks - text
 

Kürzlich hochgeladen

Kürzlich hochgeladen (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 

PhoneGap

  • 1. http://phonegap.com Emil Varga Software Engineer @ IBM
  • 2. Develop in HTML5/CSS3 + JavaScript Deploy to multiple platforms
  • 3. Free and Open Source ● Large community ● Plugins and tools ● JavaScript frameworks xui
  • 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.
  • 7. 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
  • 8. 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)
  • 9.
  • 10. //on application start wait for phonegap to fully load document.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);
  • 11. Thanks to the PhoneGap team And Brian LeRoux
  • 12. 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/
  • 13. DIY plugins //myPlugin.js function MyPlugin() {}; MyPlugin.prototype.myAction = function(params, winCallback, failCallback){ PhoneGap.exec(winCallback, failCallback, “MyPlugin”, “myAction”, [params]); } PhoneGap.addConstructor(function(){ PhoneGap.addPlugin(“myPlugin”, new MyPlugin()); });
  • 14. DIY plugins import 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); } }