SlideShare ist ein Scribd-Unternehmen logo
1 von 78
PhoneGap
About us

@nitobi
@brianleroux
@davejohnson
native vs web




This is the only cat picture, I promise.
PhoneGap is Native


    And you write the web.
Supported Platforms

• iOS
• Android
• BlackBerry
• Symbian
• webOS
Deprecated


• Windows Mobile
• BlackBerry 4.2
Prototype Platforms

•   Bada
•   Qt by way of C++ (MeeGo, desktops, etc)
•   Qt by way of PySide
•   Windows Phone 7
•   OS X Cocoa
•   Windows by way of WebKit.NET


    (Other web business like Chrome App Store and Mozilla’s
    Open Web apps are interesting to us.)
Contributer Concerns
tests currently live at
http://github.com/phonegap/mobile-spec
docs can be viewed live here
http://docs.phonegap.com
issue tracker can be viewed here
http://phonegap.lighthouseapp.com
wiki we use for planning here
http://wiki.phonegap.com
PhoneGap Technique

1. Instantiate a chromeless browser instance.
2. Implement PhoneGap.exec bridge code.
3. Implement native plugin code.
4. Implement your JS API by wrapping
   PhoneGap.exec() into something pretty.
PhoneGap.exec


...
 }
iOS PhoneGap.exec

1. Init a webview
2. Establish a Native to JavaScript bridge
3. Establish a JavaScript to Native bridge
iOS init webview




* PhoneGapDelegate.m line 178
iOS Native to JS




This was what inspired the original hack!
iOS JS to Native
document.location
// I shit you not
Android


• Almost the same, except its the opposite.
• Also, a saga of experimentation.
Android webview

import android.webkit.*




      * DroidGap.java
Android JS to Native
    Old School




Ok, that part is easy! No URL hacking!
Unfortunately...

Nasty bug in Android 2.3 emulators caused
      addJavaScriptInterface to fail...


       Possibly some devices too.
Android JS to Native
    Nu School

    onJsPrompt override
onJsPrompt
// I shit you not
Android Native to JS

           loadUrl
       CallbackServer




     The saga continues...
Android Native to JS




* ghetto, but it works and did work for a very long time
Android Native to JS


 com.phonegap.CallBackServer.java
Android Native to JS
Learnings.

• Android imp details have changed or
  manifested bugs. Our interface has not!
• Never underestimate the determination of
  an engineer to abandon all ‘best practices’
  in light of solving a tough problem.
BlackBerry webview
BlackBerry webview
// you can’t make this stuff up!
4.2
document.cookie
// I shit you not
BlackBerry JS to Native
BlackBerry Native to JS
Symbian Bridge


• A simple JS shim on top of WRT
webOS Bridge


• Another shim... but things are getting
  interesting here.
• NodeJS is available as of webOS 2.0!
Other places


• WP7 gives us the ability to bind C# to IE.
• Bada and Qt give near full access to
  WebKit.
Device APIs


• sensors
• data
Sensors

• GPS
• Network
• Camera
• Battery
Data


• Contacts
• Media
API “design”
The “standards” are a mess.




Quotes here are not ironic.
Browser APIs...
Or maybe like this?
Browser Persistence
       APIs


• SQLite has been a complete fuck up.
WAC


• formerly JIL and BONDI
• a carrier consortium
WAC
Browser Media APIs

• lets not even go here..
• audio and video are horribly fucked up
• ESPECIALLY on mobile
• we fix em w/ PhoneGap tho!
DAP Media Capture
DAP System Info
DAP Sys Info
DAP API Overview
Contacts
Calendar
Media Capture
Messaging
System Info
Permissions
Gallery
App Launcher
Tasks
WAC API Overview
Accelerometer
Orientation
Camera
Device Status
Filesystem
Messaging
Geolocation
Contacts
Calendar
Tasks
Web-ish SDKs Trending..

 • Symbian WRT
 • HP Palm webOS
 • BlackBerry WebWorks
 • Samsung Bada
     * PhoneGap started in 2008 btw...
Everyone Differentiates
  And their target abstraction is JavaScript?
Current PhoneGap API
Accelerometer
Camera
Compass
Contacts
Device
Events
File
Geolocation
Media
Network
Notication
Storage
Plugins to the rescue
Clean from an engineering perspective.
Lighter builds possible.
Adaptable for 3rd party extensions.
Portable to new platforms.
Secure only use what you need.

Override anything with JS or Native code.
Plugin Native Interface
Plugin JS Interface
Remaining work

• Discovery
• Packaging / installation
• Identity / trust
PhoneGap Plugins 1.0
Core
Maintained by us.


Community
Wild west!


Partner
Maintained by you; veried by us. =)
So, what did we learn?

 • Devices tend to ship a browser.
 • Additionally they have an SDK.
 • Browsers have a location.

You have everything required to create a bridge!
Mobile web rst!

• Basics.
• Tooling.
• Libraries.
Basics: HTML


<button>I’m native codes!</button>
Basics: CSS3

• media queries come in handy for tablets
• many folk using precompilers these days
• opacity, rounded corners, gradients and
  fucking drop shadows fuck ya!
Basics: JavaScript

• Language of the web.
• Scheme with a C syntax.
• Some quirks: http://wtfjs.com
Basics: cong.xml

• Lifted from the W3C Widget Spec
• Many variants. See rubygem ‘confetti’
• Handy for packaging metadata.
• Wtf is packaging metadata?
cong.xml
• specify assets for loading in various places
  that might be stored in other various places.
• icon, splash screen, index.html path and js
  pathing
• feature capability / security
• network restrictions security
• title, description, license, author, etc
cong.xml example
Tooling

• Compilers/Minifyers
• IDES
• Emulators
• Debuggers
Compilers/Miniers

• YUICompressor
• Google Closure
• UglyfyJS
IDES

• VIM / Emacs
• Textmate
• Eclipse
• Dreamweaver
Emulators

• Every SDK has one. Most of them suck.
• ios-sim
• Ripple
• WebKit, eh
Debuggers

• WebKit nightly is your friend. Mine too.
• weinre
• console.log is supported btw
Libraries

• DOM
• Testing
• Style/GUI
• Persistence
DOM Libs

• XUI
• Zepto
• jQuery
• Dojo
• html5 mobile boilerplate?
Testing Libs

• QUnit
• Jasmine
• DominatorJS
• ThumbsJS
Style / GUI

• jquery mobile
• sencha touch
• dojo mobile
• jo
Persistence


• Lawnchair
• PersistJS
other concerns
• toolchain setup is a pain
• phonegap/build
• competition?
• performance of webviews is terrible! my
  rounded corners and css gradients tear!
• security: there is none!

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to PhoneGap
Introduction to PhoneGapIntroduction to PhoneGap
Introduction to PhoneGap
degarden
 
Building Native Mobile Applications with PhoneGap
Building Native Mobile Applications with PhoneGapBuilding Native Mobile Applications with PhoneGap
Building Native Mobile Applications with PhoneGap
Simon MacDonald
 

Was ist angesagt? (20)

Introduction to PhoneGap
Introduction to PhoneGapIntroduction to PhoneGap
Introduction to PhoneGap
 
Building Hybrid Applications using PhoneGap
Building Hybrid Applications using PhoneGapBuilding Hybrid Applications using PhoneGap
Building Hybrid Applications using PhoneGap
 
Building mobile apps using Phonegap
Building mobile apps using PhonegapBuilding mobile apps using Phonegap
Building mobile apps using Phonegap
 
Introduction to PhoneGap
Introduction to PhoneGapIntroduction to PhoneGap
Introduction to PhoneGap
 
Phone gap
Phone gapPhone gap
Phone gap
 
All About Phonegap
All About Phonegap All About Phonegap
All About Phonegap
 
PhoneGap: Building Mobile Applications with HTML/JS
PhoneGap: Building Mobile Applications with HTML/JSPhoneGap: Building Mobile Applications with HTML/JS
PhoneGap: Building Mobile Applications with HTML/JS
 
Adobe and Modern Web Development
Adobe and Modern Web DevelopmentAdobe and Modern Web Development
Adobe and Modern Web Development
 
Introduction to PhoneGap
Introduction to PhoneGapIntroduction to PhoneGap
Introduction to PhoneGap
 
Titanium @ Minnebar
Titanium @ MinnebarTitanium @ Minnebar
Titanium @ Minnebar
 
Firefox OS - HTML5 for a truly world-wide-web
Firefox OS - HTML5 for a truly world-wide-webFirefox OS - HTML5 for a truly world-wide-web
Firefox OS - HTML5 for a truly world-wide-web
 
Strategies for securing your banks & enterprises (from someone who robs bank...
 Strategies for securing your banks & enterprises (from someone who robs bank... Strategies for securing your banks & enterprises (from someone who robs bank...
Strategies for securing your banks & enterprises (from someone who robs bank...
 
From mobile browser to mobile app
From mobile browser to mobile appFrom mobile browser to mobile app
From mobile browser to mobile app
 
React Native
React NativeReact Native
React Native
 
Debugging and deploying with phone gap
Debugging and deploying with phone gapDebugging and deploying with phone gap
Debugging and deploying with phone gap
 
Can we make es6 the baseline of the “modern web”? - BrazilJS 2105
Can we make es6 the baseline of the “modern web”? - BrazilJS 2105 Can we make es6 the baseline of the “modern web”? - BrazilJS 2105
Can we make es6 the baseline of the “modern web”? - BrazilJS 2105
 
Building Native Mobile Applications with PhoneGap
Building Native Mobile Applications with PhoneGapBuilding Native Mobile Applications with PhoneGap
Building Native Mobile Applications with PhoneGap
 
Developing with Phonegap - Adobe Refresh 2012
Developing with Phonegap - Adobe Refresh 2012Developing with Phonegap - Adobe Refresh 2012
Developing with Phonegap - Adobe Refresh 2012
 
Make Cross Platform Apps that Suck Less
Make Cross Platform Apps that Suck LessMake Cross Platform Apps that Suck Less
Make Cross Platform Apps that Suck Less
 
Hybrid app development with ionic
Hybrid app development with ionicHybrid app development with ionic
Hybrid app development with ionic
 

Ähnlich wie Phonegap for Engineers

HTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There TodayHTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
davyjones
 
20120802 timisoara
20120802 timisoara20120802 timisoara
20120802 timisoara
Richard Rodger
 
20120306 dublin js
20120306 dublin js20120306 dublin js
20120306 dublin js
Richard Rodger
 
Mobeers waterloo-2011
Mobeers waterloo-2011Mobeers waterloo-2011
Mobeers waterloo-2011
Brian LeRoux
 
State of jQuery - AspDotNetStorefront Conference
State of jQuery - AspDotNetStorefront ConferenceState of jQuery - AspDotNetStorefront Conference
State of jQuery - AspDotNetStorefront Conference
dmethvin
 
An overview of mobile html + java script frameworks
An overview of mobile html + java script frameworksAn overview of mobile html + java script frameworks
An overview of mobile html + java script frameworks
Sasha dos Santos
 
Philly ete-2011
Philly ete-2011Philly ete-2011
Philly ete-2011
davyjones
 
Hybrid Mobile Development with Apache Cordova and
Hybrid Mobile Development with Apache Cordova and Hybrid Mobile Development with Apache Cordova and
Hybrid Mobile Development with Apache Cordova and
Ryan Cuprak
 

Ähnlich wie Phonegap for Engineers (20)

HTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There TodayHTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
 
Txjs
TxjsTxjs
Txjs
 
20120802 timisoara
20120802 timisoara20120802 timisoara
20120802 timisoara
 
Mobile native-hacks
Mobile native-hacksMobile native-hacks
Mobile native-hacks
 
20120306 dublin js
20120306 dublin js20120306 dublin js
20120306 dublin js
 
Webview: The fifth element
Webview: The fifth elementWebview: The fifth element
Webview: The fifth element
 
"WebView, the fifth element" por @fernando_cejas
"WebView, the fifth element" por @fernando_cejas"WebView, the fifth element" por @fernando_cejas
"WebView, the fifth element" por @fernando_cejas
 
Developing Windows Phone 8 apps using PhoneGap
Developing Windows Phone 8 apps using PhoneGapDeveloping Windows Phone 8 apps using PhoneGap
Developing Windows Phone 8 apps using PhoneGap
 
Mobeers waterloo-2011
Mobeers waterloo-2011Mobeers waterloo-2011
Mobeers waterloo-2011
 
State of jQuery - AspDotNetStorefront Conference
State of jQuery - AspDotNetStorefront ConferenceState of jQuery - AspDotNetStorefront Conference
State of jQuery - AspDotNetStorefront Conference
 
Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)
Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)
Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)
 
移动端Web app开发
移动端Web app开发移动端Web app开发
移动端Web app开发
 
An overview of mobile html + java script frameworks
An overview of mobile html + java script frameworksAn overview of mobile html + java script frameworks
An overview of mobile html + java script frameworks
 
Philly ete-2011
Philly ete-2011Philly ete-2011
Philly ete-2011
 
Cross-Platform Development
Cross-Platform DevelopmentCross-Platform Development
Cross-Platform Development
 
Synapse india reviews on mobile application development
Synapse india reviews on mobile application developmentSynapse india reviews on mobile application development
Synapse india reviews on mobile application development
 
Your choices for building a mobile app in 2016
Your choices for building a mobile app in 2016Your choices for building a mobile app in 2016
Your choices for building a mobile app in 2016
 
Hybrid Mobile Development with Apache Cordova and
Hybrid Mobile Development with Apache Cordova and Hybrid Mobile Development with Apache Cordova and
Hybrid Mobile Development with Apache Cordova and
 
Node
NodeNode
Node
 
Hybrid Apps with Angular & Ionic Framework
Hybrid Apps with Angular & Ionic FrameworkHybrid Apps with Angular & Ionic Framework
Hybrid Apps with Angular & Ionic Framework
 

Mehr von Brian LeRoux (9)

TxJS 2011
TxJS 2011TxJS 2011
TxJS 2011
 
After HTML5 Mobilism 2011
After HTML5 Mobilism 2011After HTML5 Mobilism 2011
After HTML5 Mobilism 2011
 
Mobile Knife Fighting at JSConf US
Mobile Knife Fighting at JSConf US Mobile Knife Fighting at JSConf US
Mobile Knife Fighting at JSConf US
 
Fullfrontal 2010
Fullfrontal 2010Fullfrontal 2010
Fullfrontal 2010
 
Palm Developer Day PhoneGap
Palm Developer Day PhoneGap Palm Developer Day PhoneGap
Palm Developer Day PhoneGap
 
Scurvyconf
ScurvyconfScurvyconf
Scurvyconf
 
Mobile Web App Development
Mobile Web App DevelopmentMobile Web App Development
Mobile Web App Development
 
Mobile JavaScript
Mobile JavaScriptMobile JavaScript
Mobile JavaScript
 
Phonegap 1.0
Phonegap 1.0Phonegap 1.0
Phonegap 1.0
 

KĂźrzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

KĂźrzlich hochgeladen (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

Phonegap for Engineers

Hinweis der Redaktion

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n
  78. \n