SlideShare uma empresa Scribd logo
1 de 25
Baixar para ler offline
Emerging Internet Technologies




Building Native Mobile Applications with
PhoneGap


         Becky Gibson
         Simon MacDonald



                                           © 2011 IBM Corporation
Emerging Internet Technologies




Agenda

      Mobile Application Overview
      What is PhoneGap?
      PhoneGap Architecture
      Extending PhoneGap
      Building an App
      Summary




2         Building Native Mobile Applications with PhoneGap   © 2011 IBM Corporation
Emerging Internet Technologies




Mobile Space




                                              http://www.abmuku.com/2011/02/24/technology/american-cell-phone-usage-infographic/


3       Building Native Mobile Applications with PhoneGap                                                 © 2011 IBM Corporation
Emerging Internet Technologies




Everyone Wants a Piece of that Pie!




4        Building Native Mobile Applications with PhoneGap   © 2011 IBM Corporation
Emerging Internet Technologies




Mobile Web Apps

       Fast, easy, simple
       Run in mobile browsers
       Built on W3C technologies
       Minimal access to device features




5        Building Native Mobile Applications with PhoneGap   © 2011 IBM Corporation
Emerging Internet Technologies




Mobile Applications

       Platform Specific
       Sold via App Stores
       Specific technologies and
        development environments
       Licensing agreements




6        Building Native Mobile Applications with PhoneGap   © 2011 IBM Corporation
Emerging Internet Technologies




Hybrid Applications

        Built with Web Technologies
        Access to Device Features
        Distributed via App Stores
        Some platform specific knowledge
        Licensing Agreements




7        Building Native Mobile Applications with PhoneGap   © 2011 IBM Corporation
Emerging Internet Technologies




Mobile App Comparison
                                         Web                         Hybrid            Native

    Dev cost                             Reasonable                  Reasonable        Expensive


    Dev time                             Short                       Short             Long


    App portability                      High                        High              None

                                                                     Native speed if
    Performance                          Fast
                                                                     needed
                                                                                       Very Fast

    Native
                                         No                          All               All
    functionality
    App store
                                         No                          Yes               Yes
    distribution

    Extensible                           No                          Yes               Yes

8                Building Native Mobile Applications with PhoneGap                                 © 2011 IBM Corporation
Emerging Internet Technologies




What’s a Developer to Do?




9       Building Native Mobile Applications with PhoneGap   © 2011 IBM Corporation
Emerging Internet Technologies




What is PhoneGap?

     It’s a tool for building mobile apps using Web technologies




             HTML For Layout
             JavaScript to access device functionality
                    navigator.notification.vibrate()
             CSS for rich look and feel
             Standards Based
10            Building Native Mobile Applications with PhoneGap   © 2011 IBM Corporation
Emerging Internet Technologies




How Does PhoneGap Work?




11     Building Native Mobile Applications with PhoneGap   © 2011 IBM Corporation
Emerging Internet Technologies




PhoneGap Community

       Started by Nitobi in 2008
       Large, active open-source community
       350,000 downloads, 175,000 visits/month, 5000+ forum
        members
       Open Source – http://github.com/phonegap
            – Apache2 inbound (CLA)
            – MIT & BSD outbound
       Companies participating: IBM, RIM, Microsoft
       1.0 Release July, 2011




12       Building Native Mobile Applications with PhoneGap   © 2011 IBM Corporation
Emerging Internet Technologies




PhoneGap Apps

     How many are there?

     You can’t tell!
        (unless you are told)



http://www.phonegap.com/apps




13             Building Native Mobile Applications with PhoneGap   © 2011 IBM Corporation
Emerging Internet Technologies




PhoneGap Features
                                                 Core APIs
     –  Media (audio play/record)                              –    Accelerometer
     –  Media Capture: audio, video,                           –    Compass
        camera – (W3C)                                         –    Camera
     –  Network (W3C)                                          –    Contacts (W3C)
     –  Notification                                           –    File (W3C)
     –  Storage (HTML5 Web SQL &                               –    File Transfer
        Web Storage)
                                                               –    Geolocation (HTML5)




14         Building Native Mobile Applications with PhoneGap                          © 2011 IBM Corporation
Emerging Internet Technologies




Typical Architecture

        HTML/JS/CSS + graphic assets are on the device,
         packaged as part of the build process.
        JavaScript can store retrieved data in a SQLite
         database or from localStorage (key/value pair) for
         offline access.
        Often a server component involved.
        JavaScript communicates with the server via XHR to
         get retrieve data.
        Yes, you can load your app remotely with caveats.




15       Building Native Mobile Applications with PhoneGap   © 2011 IBM Corporation
Emerging Internet Technologies



     PhoneGap Architecture Diagram
                                                                   PhoneGap
                                                                   Application
         Web App                                                                        PhoneGap Plug-ins
          HTML                   JavaScript                                              Accelerometer       Geolocation
          CSS                    Resources                                               Camera              Media
                                                                                         Compass             Network
                                      PhoneGap




                                                                                         Contacts            Notification
                                                 JS APIs
                 HTML
                 APIs




                                                                                         File                Storage

         HTML Rendering Engine                                                           Custom Plug-ins
                                                                      PhoneGap
         (WebView)                                                    Native APIs
                            OS APIs




                                                                                                            OS APIs
                                                           Services                 Sensors
       Mobile OS
                                                           Input                    Graphics


16              Building Native Mobile Applications with PhoneGap                                                      © 2011 IBM Corporation
Emerging Internet Technologies




Writing for Multiple Devices

        Use a JavaScript Toolkit!
          Most support at least Android and iOS
              Remember that size matters!




                                             Sencha Touch




            Mobile Dojo


17       Building Native Mobile Applications with PhoneGap   © 2011 IBM Corporation
Emerging Internet Technologies




Best Practices
       Where possible use single HTML page
              Use JavaScript to show/hide page elements based on
               user interaction instead of linking to a separate page.
              Those JavaScript toolkits come in handy here!
       Obfuscate / crunch your JavaScript before release
       Consider offline usage
               navigator.network.connection.type
               online /offline events
               Note: Apple checks for offline support
       Utilize persistent storage
               File APIs
               Storage APIs
               SQL Lite / Lawnchair


18       Building Native Mobile Applications with PhoneGap      © 2011 IBM Corporation
Emerging Internet Technologies




Using PhoneGap


     1.  Create resources in www directory
     2.  Include phonegap.*.js in your start page (usually
         index.html)
     3.  Create onload handler
     4.  In onload handler register for deviceReady event
         from PhoneGap
     5.  When deviceready fires PhoneGap is ready.
     6.  Build, install and test for each platform




19      Building Native Mobile Applications with PhoneGap   © 2011 IBM Corporation
Emerging Internet Technologies




Building a PhoneGap App




                                          DEMO




20      Building Native Mobile Applications with PhoneGap   © 2011 IBM Corporation
Emerging Internet Technologies




Debugging?



                         Console.log is your friend!



       Wednesday @ 4:10pm – Portland 252
       Debugging Mobile Web Applications with
       weinre
       Patrick Mueller (IBM)



21     Building Native Mobile Applications with PhoneGap   © 2011 IBM Corporation
Emerging Internet Technologies




Extending PhoneGap
       Provide native code and JavaScript API
       – Extend Existing Features
       – Support for new sensors (NFC, ...)
       Examples of current plug-ins
       – http://github.com/phonegap/phonegap-plugins
       – Barcode scanner (Android, iOS)
       – Clipboard manager (Android, iOS)
       – Child browser (Android, iOS)
       – Contact viewer (Android)
       – iAd (iOS)
       – PayPal (iOS)

22       Building Native Mobile Applications with PhoneGap   © 2011 IBM Corporation
Emerging Internet Technologies




Future
       Additional Features
             Plugin Only Architecture
             W3C APIs
                 Web Notifications
                 Calendar
                 Messaging
             Crypto / security
             Menus
             More at
              http://wiki.phonegap.com/w/page/28291160/
              roadmap-planning
       We want YOU to contribute code!
             Bug fixes
             Plugins

23        Building Native Mobile Applications with PhoneGap   © 2011 IBM Corporation
Emerging Internet Technologies




Other PhoneGap folks presenting @ OSCON

       Wednesday @ 5:00pm - Portland 252
       Android WebKit Development - A
       Cautionary Tale
       Joe Bowser (Nitobi)

        Thursday @2:30pm – Portland Ballroom
        HTML5 and Mobile: Getting from Good
        Enough to Great
        Filip Maj (Nitobi)



24      Building Native Mobile Applications with PhoneGap   © 2011 IBM Corporation
Emerging Internet Technologies




Resources
       More Info
        –  http://www.phonegap.com/
       Getting Started
        – http://www.phonegap.com/start
       Mailing List / Google Group
        – http://groups.google.com/group/phonegap
       API Documentation
        – http://docs.phonegap.com/
       Wiki
        – http://wiki.phonegap.com/w/page/16494772/FrontPage
       CODE
        – http://github.com/phonegap

25       Building Native Mobile Applications with PhoneGap   © 2011 IBM Corporation

Mais conteúdo relacionado

Mais procurados

Hybrid App Development with PhoneGap
Hybrid App Development with PhoneGapHybrid App Development with PhoneGap
Hybrid App Development with PhoneGapDotitude
 
Introduction to PhoneGap
Introduction to PhoneGapIntroduction to PhoneGap
Introduction to PhoneGapdegarden
 
Getting Acquainted with PhoneGap
Getting Acquainted with PhoneGapGetting Acquainted with PhoneGap
Getting Acquainted with PhoneGapJoseph Labrecque
 
PhoneGap Talk @ Sencha Con 2010
PhoneGap Talk @ Sencha Con 2010PhoneGap Talk @ Sencha Con 2010
PhoneGap Talk @ Sencha Con 2010alunny
 
Introduction to PhoneGap
Introduction to PhoneGapIntroduction to PhoneGap
Introduction to PhoneGapQuang Minh Dao
 
Mobile Drupal
Mobile DrupalMobile Drupal
Mobile DrupalTwinbit
 
From mobile browser to mobile app
From mobile browser to mobile appFrom mobile browser to mobile app
From mobile browser to mobile appRyan Stewart
 
PhoneGap: a brief history and apologia
PhoneGap: a brief history and apologiaPhoneGap: a brief history and apologia
PhoneGap: a brief history and apologialorinbeer
 
Building Mobile Cross-Platform Apps with HTML5, jQuery Mobile & PhoneGap
Building Mobile Cross-Platform Apps with HTML5, jQuery Mobile & PhoneGapBuilding Mobile Cross-Platform Apps with HTML5, jQuery Mobile & PhoneGap
Building Mobile Cross-Platform Apps with HTML5, jQuery Mobile & PhoneGapNick Landry
 
Developing with Phonegap - Adobe Refresh 2012
Developing with Phonegap - Adobe Refresh 2012Developing with Phonegap - Adobe Refresh 2012
Developing with Phonegap - Adobe Refresh 2012Ryan Stewart
 
Debugging and deploying with phone gap
Debugging and deploying with phone gapDebugging and deploying with phone gap
Debugging and deploying with phone gapRyan Stewart
 
Phone gap in android technology
Phone gap in android technologyPhone gap in android technology
Phone gap in android technologyVikrant Thakare
 
Cordova and PhoneGap Insights
Cordova and PhoneGap InsightsCordova and PhoneGap Insights
Cordova and PhoneGap InsightsMonaca
 
Hybrid Mobile Applications
Hybrid Mobile ApplicationsHybrid Mobile Applications
Hybrid Mobile ApplicationsRuwan Ranganath
 
Cordova / PhoneGap, mobile apps development with HTML5/JS/CSS
Cordova / PhoneGap, mobile apps development with HTML5/JS/CSSCordova / PhoneGap, mobile apps development with HTML5/JS/CSS
Cordova / PhoneGap, mobile apps development with HTML5/JS/CSSGabriel Huecas
 
HTML5를 활용한 하이브리드 앱개발하기
HTML5를 활용한 하이브리드 앱개발하기HTML5를 활용한 하이브리드 앱개발하기
HTML5를 활용한 하이브리드 앱개발하기정현 황
 
Cordova + Ionic + MobileFirst
Cordova + Ionic + MobileFirstCordova + Ionic + MobileFirst
Cordova + Ionic + MobileFirstRaymond Camden
 

Mais procurados (20)

Hybrid App Development with PhoneGap
Hybrid App Development with PhoneGapHybrid App Development with PhoneGap
Hybrid App Development with PhoneGap
 
Introduction to PhoneGap
Introduction to PhoneGapIntroduction to PhoneGap
Introduction to PhoneGap
 
Phone gap
Phone gapPhone gap
Phone gap
 
Getting Acquainted with PhoneGap
Getting Acquainted with PhoneGapGetting Acquainted with PhoneGap
Getting Acquainted with PhoneGap
 
PhoneGap Talk @ Sencha Con 2010
PhoneGap Talk @ Sencha Con 2010PhoneGap Talk @ Sencha Con 2010
PhoneGap Talk @ Sencha Con 2010
 
Introduction to PhoneGap
Introduction to PhoneGapIntroduction to PhoneGap
Introduction to PhoneGap
 
Mobile Drupal
Mobile DrupalMobile Drupal
Mobile Drupal
 
From mobile browser to mobile app
From mobile browser to mobile appFrom mobile browser to mobile app
From mobile browser to mobile app
 
PhoneGap: a brief history and apologia
PhoneGap: a brief history and apologiaPhoneGap: a brief history and apologia
PhoneGap: a brief history and apologia
 
Phonegap - An Overview
Phonegap - An OverviewPhonegap - An Overview
Phonegap - An Overview
 
Building Mobile Cross-Platform Apps with HTML5, jQuery Mobile & PhoneGap
Building Mobile Cross-Platform Apps with HTML5, jQuery Mobile & PhoneGapBuilding Mobile Cross-Platform Apps with HTML5, jQuery Mobile & PhoneGap
Building Mobile Cross-Platform Apps with HTML5, jQuery Mobile & PhoneGap
 
Developing with Phonegap - Adobe Refresh 2012
Developing with Phonegap - Adobe Refresh 2012Developing with Phonegap - Adobe Refresh 2012
Developing with Phonegap - Adobe Refresh 2012
 
Debugging and deploying with phone gap
Debugging and deploying with phone gapDebugging and deploying with phone gap
Debugging and deploying with phone gap
 
Phone gap in android technology
Phone gap in android technologyPhone gap in android technology
Phone gap in android technology
 
Cordova and PhoneGap Insights
Cordova and PhoneGap InsightsCordova and PhoneGap Insights
Cordova and PhoneGap Insights
 
Hybrid Mobile Applications
Hybrid Mobile ApplicationsHybrid Mobile Applications
Hybrid Mobile Applications
 
Cordova / PhoneGap, mobile apps development with HTML5/JS/CSS
Cordova / PhoneGap, mobile apps development with HTML5/JS/CSSCordova / PhoneGap, mobile apps development with HTML5/JS/CSS
Cordova / PhoneGap, mobile apps development with HTML5/JS/CSS
 
Hybrid mobile apps
Hybrid mobile appsHybrid mobile apps
Hybrid mobile apps
 
HTML5를 활용한 하이브리드 앱개발하기
HTML5를 활용한 하이브리드 앱개발하기HTML5를 활용한 하이브리드 앱개발하기
HTML5를 활용한 하이브리드 앱개발하기
 
Cordova + Ionic + MobileFirst
Cordova + Ionic + MobileFirstCordova + Ionic + MobileFirst
Cordova + Ionic + MobileFirst
 

Semelhante a Building Native Mobile Applications with PhoneGap

Developing Downloadable Mobile Apps Using HTML5 and PhoneGap
Developing Downloadable Mobile Apps Using HTML5 and PhoneGapDeveloping Downloadable Mobile Apps Using HTML5 and PhoneGap
Developing Downloadable Mobile Apps Using HTML5 and PhoneGapWorklight
 
HTML5 for Mobile - When and Why
HTML5 for Mobile - When and WhyHTML5 for Mobile - When and Why
HTML5 for Mobile - When and WhyDMI
 
Drupalcamp armedia phonegap_oct2012_print
Drupalcamp armedia phonegap_oct2012_printDrupalcamp armedia phonegap_oct2012_print
Drupalcamp armedia phonegap_oct2012_printDrupalcampAtlanta2012
 
PhoneGap/PhoneGap Build - Amsterdam Adobe Camp
PhoneGap/PhoneGap Build - Amsterdam Adobe CampPhoneGap/PhoneGap Build - Amsterdam Adobe Camp
PhoneGap/PhoneGap Build - Amsterdam Adobe CampMihai Corlan
 
Midweek breather hybridapps
Midweek breather hybridappsMidweek breather hybridapps
Midweek breather hybridappsstrider1981
 
Integrating ADF Mobile with WebCenter
Integrating ADF Mobile with WebCenterIntegrating ADF Mobile with WebCenter
Integrating ADF Mobile with WebCenterBrian Huff
 
Simplifying Enterprise Mobility - Powering Mobile Apps from The Cloud
Simplifying Enterprise Mobility - Powering Mobile Apps from The CloudSimplifying Enterprise Mobility - Powering Mobile Apps from The Cloud
Simplifying Enterprise Mobility - Powering Mobile Apps from The CloudJoe Drumgoole
 
HTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applicationsHTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applicationsJames Pearce
 
Mobile Endgeräte sind überall – deshalb das mobile Portal
Mobile Endgeräte sind überall – deshalb das mobile Portal Mobile Endgeräte sind überall – deshalb das mobile Portal
Mobile Endgeräte sind überall – deshalb das mobile Portal IBM Lotus
 
DevOps for Mobile - DevOpsDays, NY, 2013
DevOps for Mobile - DevOpsDays, NY, 2013DevOps for Mobile - DevOpsDays, NY, 2013
DevOps for Mobile - DevOpsDays, NY, 2013Sanjeev Sharma
 
How to scale enterprise mobility and improve roi
How to scale enterprise mobility and improve roiHow to scale enterprise mobility and improve roi
How to scale enterprise mobility and improve roiApperian
 
Cross Platform Mobile Apps with APIs from Qcon San Francisco
Cross Platform Mobile Apps with APIs from Qcon San FranciscoCross Platform Mobile Apps with APIs from Qcon San Francisco
Cross Platform Mobile Apps with APIs from Qcon San FranciscoCA API Management
 
Road to mobile w/ Sinatra, jQuery Mobile, Spine.js and Mustache
Road to mobile w/ Sinatra, jQuery Mobile, Spine.js and MustacheRoad to mobile w/ Sinatra, jQuery Mobile, Spine.js and Mustache
Road to mobile w/ Sinatra, jQuery Mobile, Spine.js and MustacheBrian Sam-Bodden
 
Mobile porting and testing - Xoriant
Mobile porting and testing - Xoriant Mobile porting and testing - Xoriant
Mobile porting and testing - Xoriant Xoriant Corporation
 
Developing cross platform mobile applications with phone gap for windows phone
Developing cross platform mobile applications with phone gap for windows phoneDeveloping cross platform mobile applications with phone gap for windows phone
Developing cross platform mobile applications with phone gap for windows phoneColin Eberhardt
 
IBM MobileFirst Technical Overview
IBM MobileFirst Technical OverviewIBM MobileFirst Technical Overview
IBM MobileFirst Technical Overviewibmmobile
 

Semelhante a Building Native Mobile Applications with PhoneGap (20)

Developing Downloadable Mobile Apps Using HTML5 and PhoneGap
Developing Downloadable Mobile Apps Using HTML5 and PhoneGapDeveloping Downloadable Mobile Apps Using HTML5 and PhoneGap
Developing Downloadable Mobile Apps Using HTML5 and PhoneGap
 
HTML5 for Mobile - When and Why
HTML5 for Mobile - When and WhyHTML5 for Mobile - When and Why
HTML5 for Mobile - When and Why
 
Drupalcamp armedia phonegap_oct2012_print
Drupalcamp armedia phonegap_oct2012_printDrupalcamp armedia phonegap_oct2012_print
Drupalcamp armedia phonegap_oct2012_print
 
PhoneGap/PhoneGap Build - Amsterdam Adobe Camp
PhoneGap/PhoneGap Build - Amsterdam Adobe CampPhoneGap/PhoneGap Build - Amsterdam Adobe Camp
PhoneGap/PhoneGap Build - Amsterdam Adobe Camp
 
Midweek breather hybridapps
Midweek breather hybridappsMidweek breather hybridapps
Midweek breather hybridapps
 
Integrating ADF Mobile with WebCenter
Integrating ADF Mobile with WebCenterIntegrating ADF Mobile with WebCenter
Integrating ADF Mobile with WebCenter
 
Simplifying Enterprise Mobility - Powering Mobile Apps from The Cloud
Simplifying Enterprise Mobility - Powering Mobile Apps from The CloudSimplifying Enterprise Mobility - Powering Mobile Apps from The Cloud
Simplifying Enterprise Mobility - Powering Mobile Apps from The Cloud
 
HTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applicationsHTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applications
 
Salesforce touch
Salesforce touchSalesforce touch
Salesforce touch
 
Magic xpa total mobility experience
Magic xpa  total mobility experienceMagic xpa  total mobility experience
Magic xpa total mobility experience
 
Mobile Endgeräte sind überall – deshalb das mobile Portal
Mobile Endgeräte sind überall – deshalb das mobile Portal Mobile Endgeräte sind überall – deshalb das mobile Portal
Mobile Endgeräte sind überall – deshalb das mobile Portal
 
DevOps for Mobile - DevOpsDays, NY, 2013
DevOps for Mobile - DevOpsDays, NY, 2013DevOps for Mobile - DevOpsDays, NY, 2013
DevOps for Mobile - DevOpsDays, NY, 2013
 
How to scale enterprise mobility and improve roi
How to scale enterprise mobility and improve roiHow to scale enterprise mobility and improve roi
How to scale enterprise mobility and improve roi
 
Cross Platform Mobile Apps with APIs from Qcon San Francisco
Cross Platform Mobile Apps with APIs from Qcon San FranciscoCross Platform Mobile Apps with APIs from Qcon San Francisco
Cross Platform Mobile Apps with APIs from Qcon San Francisco
 
Road to mobile w/ Sinatra, jQuery Mobile, Spine.js and Mustache
Road to mobile w/ Sinatra, jQuery Mobile, Spine.js and MustacheRoad to mobile w/ Sinatra, jQuery Mobile, Spine.js and Mustache
Road to mobile w/ Sinatra, jQuery Mobile, Spine.js and Mustache
 
Mobile porting and testing - Xoriant
Mobile porting and testing - Xoriant Mobile porting and testing - Xoriant
Mobile porting and testing - Xoriant
 
Developing cross platform mobile applications with phone gap for windows phone
Developing cross platform mobile applications with phone gap for windows phoneDeveloping cross platform mobile applications with phone gap for windows phone
Developing cross platform mobile applications with phone gap for windows phone
 
Hybrid Apps / iPhoneDevCon 2010
Hybrid Apps / iPhoneDevCon 2010Hybrid Apps / iPhoneDevCon 2010
Hybrid Apps / iPhoneDevCon 2010
 
IBM MobileFirst Technical Overview
IBM MobileFirst Technical OverviewIBM MobileFirst Technical Overview
IBM MobileFirst Technical Overview
 
Mobile Apps Develpment - A Comparison
Mobile Apps Develpment - A ComparisonMobile Apps Develpment - A Comparison
Mobile Apps Develpment - A Comparison
 

Último

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
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 interpreternaman860154
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
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 MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 

Último (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
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
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 

Building Native Mobile Applications with PhoneGap

  • 1. Emerging Internet Technologies Building Native Mobile Applications with PhoneGap Becky Gibson Simon MacDonald © 2011 IBM Corporation
  • 2. Emerging Internet Technologies Agenda   Mobile Application Overview   What is PhoneGap?   PhoneGap Architecture   Extending PhoneGap   Building an App   Summary 2 Building Native Mobile Applications with PhoneGap © 2011 IBM Corporation
  • 3. Emerging Internet Technologies Mobile Space http://www.abmuku.com/2011/02/24/technology/american-cell-phone-usage-infographic/ 3 Building Native Mobile Applications with PhoneGap © 2011 IBM Corporation
  • 4. Emerging Internet Technologies Everyone Wants a Piece of that Pie! 4 Building Native Mobile Applications with PhoneGap © 2011 IBM Corporation
  • 5. Emerging Internet Technologies Mobile Web Apps   Fast, easy, simple   Run in mobile browsers   Built on W3C technologies   Minimal access to device features 5 Building Native Mobile Applications with PhoneGap © 2011 IBM Corporation
  • 6. Emerging Internet Technologies Mobile Applications   Platform Specific   Sold via App Stores   Specific technologies and development environments   Licensing agreements 6 Building Native Mobile Applications with PhoneGap © 2011 IBM Corporation
  • 7. Emerging Internet Technologies Hybrid Applications   Built with Web Technologies   Access to Device Features   Distributed via App Stores   Some platform specific knowledge   Licensing Agreements 7 Building Native Mobile Applications with PhoneGap © 2011 IBM Corporation
  • 8. Emerging Internet Technologies Mobile App Comparison Web Hybrid Native Dev cost Reasonable Reasonable Expensive Dev time Short Short Long App portability High High None Native speed if Performance Fast needed Very Fast Native No All All functionality App store No Yes Yes distribution Extensible No Yes Yes 8 Building Native Mobile Applications with PhoneGap © 2011 IBM Corporation
  • 9. Emerging Internet Technologies What’s a Developer to Do? 9 Building Native Mobile Applications with PhoneGap © 2011 IBM Corporation
  • 10. Emerging Internet Technologies What is PhoneGap? It’s a tool for building mobile apps using Web technologies HTML For Layout JavaScript to access device functionality navigator.notification.vibrate() CSS for rich look and feel Standards Based 10 Building Native Mobile Applications with PhoneGap © 2011 IBM Corporation
  • 11. Emerging Internet Technologies How Does PhoneGap Work? 11 Building Native Mobile Applications with PhoneGap © 2011 IBM Corporation
  • 12. Emerging Internet Technologies PhoneGap Community   Started by Nitobi in 2008   Large, active open-source community   350,000 downloads, 175,000 visits/month, 5000+ forum members   Open Source – http://github.com/phonegap – Apache2 inbound (CLA) – MIT & BSD outbound   Companies participating: IBM, RIM, Microsoft   1.0 Release July, 2011 12 Building Native Mobile Applications with PhoneGap © 2011 IBM Corporation
  • 13. Emerging Internet Technologies PhoneGap Apps How many are there? You can’t tell! (unless you are told) http://www.phonegap.com/apps 13 Building Native Mobile Applications with PhoneGap © 2011 IBM Corporation
  • 14. Emerging Internet Technologies PhoneGap Features Core APIs –  Media (audio play/record) –  Accelerometer –  Media Capture: audio, video, –  Compass camera – (W3C) –  Camera –  Network (W3C) –  Contacts (W3C) –  Notification –  File (W3C) –  Storage (HTML5 Web SQL & –  File Transfer Web Storage) –  Geolocation (HTML5) 14 Building Native Mobile Applications with PhoneGap © 2011 IBM Corporation
  • 15. Emerging Internet Technologies Typical Architecture   HTML/JS/CSS + graphic assets are on the device, packaged as part of the build process.   JavaScript can store retrieved data in a SQLite database or from localStorage (key/value pair) for offline access.   Often a server component involved.   JavaScript communicates with the server via XHR to get retrieve data.   Yes, you can load your app remotely with caveats. 15 Building Native Mobile Applications with PhoneGap © 2011 IBM Corporation
  • 16. Emerging Internet Technologies PhoneGap Architecture Diagram PhoneGap Application Web App PhoneGap Plug-ins HTML JavaScript Accelerometer Geolocation CSS Resources Camera Media Compass Network PhoneGap Contacts Notification JS APIs HTML APIs File Storage HTML Rendering Engine Custom Plug-ins PhoneGap (WebView) Native APIs OS APIs OS APIs Services Sensors Mobile OS Input Graphics 16 Building Native Mobile Applications with PhoneGap © 2011 IBM Corporation
  • 17. Emerging Internet Technologies Writing for Multiple Devices Use a JavaScript Toolkit! Most support at least Android and iOS Remember that size matters! Sencha Touch Mobile Dojo 17 Building Native Mobile Applications with PhoneGap © 2011 IBM Corporation
  • 18. Emerging Internet Technologies Best Practices   Where possible use single HTML page   Use JavaScript to show/hide page elements based on user interaction instead of linking to a separate page.   Those JavaScript toolkits come in handy here!   Obfuscate / crunch your JavaScript before release   Consider offline usage   navigator.network.connection.type   online /offline events   Note: Apple checks for offline support   Utilize persistent storage   File APIs   Storage APIs   SQL Lite / Lawnchair 18 Building Native Mobile Applications with PhoneGap © 2011 IBM Corporation
  • 19. Emerging Internet Technologies Using PhoneGap 1.  Create resources in www directory 2.  Include phonegap.*.js in your start page (usually index.html) 3.  Create onload handler 4.  In onload handler register for deviceReady event from PhoneGap 5.  When deviceready fires PhoneGap is ready. 6.  Build, install and test for each platform 19 Building Native Mobile Applications with PhoneGap © 2011 IBM Corporation
  • 20. Emerging Internet Technologies Building a PhoneGap App DEMO 20 Building Native Mobile Applications with PhoneGap © 2011 IBM Corporation
  • 21. Emerging Internet Technologies Debugging? Console.log is your friend! Wednesday @ 4:10pm – Portland 252 Debugging Mobile Web Applications with weinre Patrick Mueller (IBM) 21 Building Native Mobile Applications with PhoneGap © 2011 IBM Corporation
  • 22. Emerging Internet Technologies Extending PhoneGap   Provide native code and JavaScript API – Extend Existing Features – Support for new sensors (NFC, ...)   Examples of current plug-ins – http://github.com/phonegap/phonegap-plugins – Barcode scanner (Android, iOS) – Clipboard manager (Android, iOS) – Child browser (Android, iOS) – Contact viewer (Android) – iAd (iOS) – PayPal (iOS) 22 Building Native Mobile Applications with PhoneGap © 2011 IBM Corporation
  • 23. Emerging Internet Technologies Future   Additional Features   Plugin Only Architecture   W3C APIs   Web Notifications   Calendar   Messaging   Crypto / security   Menus   More at http://wiki.phonegap.com/w/page/28291160/ roadmap-planning   We want YOU to contribute code!   Bug fixes   Plugins 23 Building Native Mobile Applications with PhoneGap © 2011 IBM Corporation
  • 24. Emerging Internet Technologies Other PhoneGap folks presenting @ OSCON Wednesday @ 5:00pm - Portland 252 Android WebKit Development - A Cautionary Tale Joe Bowser (Nitobi) Thursday @2:30pm – Portland Ballroom HTML5 and Mobile: Getting from Good Enough to Great Filip Maj (Nitobi) 24 Building Native Mobile Applications with PhoneGap © 2011 IBM Corporation
  • 25. Emerging Internet Technologies Resources   More Info –  http://www.phonegap.com/   Getting Started – http://www.phonegap.com/start   Mailing List / Google Group – http://groups.google.com/group/phonegap   API Documentation – http://docs.phonegap.com/   Wiki – http://wiki.phonegap.com/w/page/16494772/FrontPage   CODE – http://github.com/phonegap 25 Building Native Mobile Applications with PhoneGap © 2011 IBM Corporation