SlideShare a Scribd company logo
1 of 28
PhoneGap
A Developers Experience
Co-owner and Developer
at
Hello! I’m Tyler Johnston
@tylerjohnst @tylerjohnst
ahoyconsulting.com
What is PhoneGap?
PhoneGap is a framework for developing cross-platform
mobile applications using HTML, CSS, and Javascript. It is
based on the Apache Cordova project and is currently
maintained by Adobe.
Wait, I thought it was native?
applications. They are displayed using a full scree
Native App - apk/ipa/etc
Native APIs
Native WebView
Your Code
What Phone Features?
• Accelerometer
• Camera
• Capture
• Compass
• Connection
• Contacts
• File
• Geolocation
• Media
• Notification
• Storage
navigator.notification.vibrate(1000)
Wonderful APIs
Where Can My App Run?
• iOS (iPhone/iPad)
• Android
• Windows Phone 7
• Blackberry OS WebWorks 7
• Symbian WRT
• webOS
• Plugin interface for accessing native code
from the Javascript API.
• Very active community, developing some
really cool stuff.
• MapKit
• Flashlight
• Barcode scanner
• NFC
• Badges
• In App Purchases
Who is using this magical
framework?
The Right Tool
• PhoneGap is like any other tool, it should be
used for the right job.
• PhoneGap accelerates using data driven
applications.
• Not a great solution for apps that require
significant horsepower to run.
The Web Can Be Fast!
Don’t let the original Facebook app fool you. It
wasn’t HTML5 that made the app slow and
clunky. It was just a bad application.
Even though it is the web you have to think
about performance from the beginning.
Bring Your Own Tools
PhoneGap just gives you a web browser. Bring your own tools
page application. There are plenty of tools out ther
WHAT I’VE LEARNED
Performance
• Lazy load as much as you can.
• Defer rendering below the “fold.” (Load 10
of the 30 sub views, then the rest.)
• Precompile templates.
• Only fetch required collections needed for
the initial view.
• _.defer/setTimeout is your friend.
Prevent “Render Flash”
• Render off screen, animate in.
• Preload images. Each additional image is another
network request. View will render before the image
request even begins.
• Even fancier to build your own local cache.
• Manually disable the splash screen after your app has
initialized.
var path = ‘path/to/img.png’;
images = {};
images[path] = new Image;
images[path].src = path;
$(body).append(images[path]);
Performance
• Minify and concat all of your CSS/JS. Each
even though it’s a mobile app there are still
network requests that are fired to local disk
but with near zero latency.
• Use image sprites if you can, again, the less
asset requests the better the app will
function and seem more “native.”
Making Compilation Easier• Middleman (with the Middleman-Phonegap
plugin)
• Ruby on Rails-like asset pipeline. Supports
all the sprockets and rails plugins for almost
all templates. (Haml, Sass, Slim, Less) If it
works with Sprockets it works with
Middleman.
• Almost zero configuration. Only depends on
Ruby.
• Minify, concat, linting. All built in.
Track your references!
Memory leaks tend to be worse on mobile as it
will cause your entire app to force closed by
the OS once it uses enough resident memory.
FastClick.js
ms delay on the “click” event. FastClick.js is a polyfi
s the difference between a responsive app and a sl
hrome for Android has removed this. FastClick acco
Animations
• All mobile phones can optimize DOM elements to be animated
using the GPU. Using the GPU will cause the animations to be
silky smooth.
• To enable GPU acceleration on a DOM element append the
following CSS rules:
• GPU enabled DOM elements take significantly more memory.
The best solution being to only place it on elements which you
wish to perform animations on. Using the * selector will lead to
lots of pain and crashes.
transform: translate3d(0,0,0);
Styling
• Just because your app can be compiled and deployed
to multiple platforms it does not mean all of your user
interactions work across all platforms.
• iOS and Android have very different ways of displaying
UI.
• Action bars are usually opposite.
• Home buttons do different functions.
• Android and Windows have physical buttons.
• Loading different stylesheets at compile time is a very
easy solution to solving that problem.
Android 2.x Makes Me Cry
• Really, really, really old version of
Webkit.
• Nasty bugs.
• Really, really, really slow.
• Lack of most of CSS3 basic
features.
• Animations
• Gradients
• Shadows (Box and Text)
PhoneGap Build is Amazing
• Handles compilation of your
application to all available
platforms.
• Code signing for deployments
to App Stores
• Removes need for entire build
environment on the local
machine
• Remote debugging
• Hydration
• Test deployments
• Free for one app, $9.99 for up
to 25. Included if you have
Deploying to the App Store
• Once you have your binary you can begin
the process of submitting your app to the
respective app store.
• All signed binaries from PhoneGap build are
ready to upload.
The Google Play store is very straight
forward. Setup your account and upload
your signed APK and you are ready to
go. There is no approval process here.
By far the easiest store to deploy to.
• First release can take upwards of a month to get approved to the store
regardless of the framework used.
• Apple has some strict guidelines on how your app should function.
• Apps may not boot to a blank screen. So assets must be stored on
the device to make sure the app loads to an interactive state.
• Requiring external libraries on the initial load will cause you to fail the
audit.
• The code that does reside on the device must make it “interactive”
enough. Apple has a rule that all apps have to “contribute” to the
iPhone experience.
• But they will (hopefully) approve you. Using PhoneGap is not grounds
enough to reject an app. There are still a ton of reasons why they will
reject you. Be diligent!
Good luck and go make some awesome
stuff!
Questions? Comments?

More Related Content

What's hot

Snappy Means Happy: Performance in Ember Apps
Snappy Means Happy: Performance in Ember AppsSnappy Means Happy: Performance in Ember Apps
Snappy Means Happy: Performance in Ember AppsMatthew Beale
 
Shift Remote: JS - PoseDance: Build a TikTok Trainer - Jennifer Looper (Micro...
Shift Remote: JS - PoseDance: Build a TikTok Trainer - Jennifer Looper (Micro...Shift Remote: JS - PoseDance: Build a TikTok Trainer - Jennifer Looper (Micro...
Shift Remote: JS - PoseDance: Build a TikTok Trainer - Jennifer Looper (Micro...Shift Conference
 
Wikipedia Mobile App with PhoneGap
Wikipedia Mobile App with PhoneGapWikipedia Mobile App with PhoneGap
Wikipedia Mobile App with PhoneGapTed Chien
 
PhoneGap - Now and the Future
PhoneGap - Now and the FuturePhoneGap - Now and the Future
PhoneGap - Now and the FutureTim Kim
 
Ionic: The Web SDK for Develop Mobile Apps.
Ionic: The Web SDK for Develop Mobile Apps.Ionic: The Web SDK for Develop Mobile Apps.
Ionic: The Web SDK for Develop Mobile Apps.Matheus Cardoso
 
Hybrid Mobile Development
Hybrid Mobile DevelopmentHybrid Mobile Development
Hybrid Mobile DevelopmentShai Raiten
 
Creating mobile apps - an introduction to Ionic (Engage 2016)
Creating mobile apps - an introduction to Ionic (Engage 2016)Creating mobile apps - an introduction to Ionic (Engage 2016)
Creating mobile apps - an introduction to Ionic (Engage 2016)Mark Leusink
 
Appium: Prime Cuts
Appium: Prime CutsAppium: Prime Cuts
Appium: Prime CutsSauce Labs
 
Phonegap for Engineers
Phonegap for EngineersPhonegap for Engineers
Phonegap for EngineersBrian LeRoux
 
Creating an hybrid app in minutes with Ionic Framework
Creating an hybrid app in minutes with Ionic FrameworkCreating an hybrid app in minutes with Ionic Framework
Creating an hybrid app in minutes with Ionic FrameworkJulien Renaux
 
Ionic framework one day training
Ionic framework one day trainingIonic framework one day training
Ionic framework one day trainingTroy Miles
 
Totally Build Apps for Free! (not really)
Totally Build Apps for Free! (not really)Totally Build Apps for Free! (not really)
Totally Build Apps for Free! (not really)Tony Hillerson
 
PSU Web 2014: UX and Design Tools That Will Improve Your Productivity
PSU Web 2014: UX and Design Tools That Will Improve Your ProductivityPSU Web 2014: UX and Design Tools That Will Improve Your Productivity
PSU Web 2014: UX and Design Tools That Will Improve Your ProductivityJennifer Aldrich
 
Building a mobile application for dot netnuke
Building a mobile application for dot netnukeBuilding a mobile application for dot netnuke
Building a mobile application for dot netnukebrchapman
 

What's hot (20)

Workshop Ionic Framework - CC FE & UX
Workshop Ionic Framework - CC FE & UXWorkshop Ionic Framework - CC FE & UX
Workshop Ionic Framework - CC FE & UX
 
Hybrid app development with ionic
Hybrid app development with ionicHybrid app development with ionic
Hybrid app development with ionic
 
Introduction to Mobile Development
Introduction to Mobile DevelopmentIntroduction to Mobile Development
Introduction to Mobile Development
 
Snappy Means Happy: Performance in Ember Apps
Snappy Means Happy: Performance in Ember AppsSnappy Means Happy: Performance in Ember Apps
Snappy Means Happy: Performance in Ember Apps
 
Shift Remote: JS - PoseDance: Build a TikTok Trainer - Jennifer Looper (Micro...
Shift Remote: JS - PoseDance: Build a TikTok Trainer - Jennifer Looper (Micro...Shift Remote: JS - PoseDance: Build a TikTok Trainer - Jennifer Looper (Micro...
Shift Remote: JS - PoseDance: Build a TikTok Trainer - Jennifer Looper (Micro...
 
Wikipedia Mobile App with PhoneGap
Wikipedia Mobile App with PhoneGapWikipedia Mobile App with PhoneGap
Wikipedia Mobile App with PhoneGap
 
Webapi
WebapiWebapi
Webapi
 
PhoneGap - Now and the Future
PhoneGap - Now and the FuturePhoneGap - Now and the Future
PhoneGap - Now and the Future
 
Ionic: The Web SDK for Develop Mobile Apps.
Ionic: The Web SDK for Develop Mobile Apps.Ionic: The Web SDK for Develop Mobile Apps.
Ionic: The Web SDK for Develop Mobile Apps.
 
Hybrid Mobile Development
Hybrid Mobile DevelopmentHybrid Mobile Development
Hybrid Mobile Development
 
Angular Connect
Angular ConnectAngular Connect
Angular Connect
 
Creating mobile apps - an introduction to Ionic (Engage 2016)
Creating mobile apps - an introduction to Ionic (Engage 2016)Creating mobile apps - an introduction to Ionic (Engage 2016)
Creating mobile apps - an introduction to Ionic (Engage 2016)
 
Appium: Prime Cuts
Appium: Prime CutsAppium: Prime Cuts
Appium: Prime Cuts
 
Phonegap for Engineers
Phonegap for EngineersPhonegap for Engineers
Phonegap for Engineers
 
Best Apps for a Business on the Go
Best Apps for a Business on the Go Best Apps for a Business on the Go
Best Apps for a Business on the Go
 
Creating an hybrid app in minutes with Ionic Framework
Creating an hybrid app in minutes with Ionic FrameworkCreating an hybrid app in minutes with Ionic Framework
Creating an hybrid app in minutes with Ionic Framework
 
Ionic framework one day training
Ionic framework one day trainingIonic framework one day training
Ionic framework one day training
 
Totally Build Apps for Free! (not really)
Totally Build Apps for Free! (not really)Totally Build Apps for Free! (not really)
Totally Build Apps for Free! (not really)
 
PSU Web 2014: UX and Design Tools That Will Improve Your Productivity
PSU Web 2014: UX and Design Tools That Will Improve Your ProductivityPSU Web 2014: UX and Design Tools That Will Improve Your Productivity
PSU Web 2014: UX and Design Tools That Will Improve Your Productivity
 
Building a mobile application for dot netnuke
Building a mobile application for dot netnukeBuilding a mobile application for dot netnuke
Building a mobile application for dot netnuke
 

Similar to Phonegap - An Introduction

Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011Nuxeo
 
Dreamweaver CS6, jQuery, PhoneGap, mobile design
Dreamweaver CS6, jQuery, PhoneGap, mobile designDreamweaver CS6, jQuery, PhoneGap, mobile design
Dreamweaver CS6, jQuery, PhoneGap, mobile designDee Sadler
 
Introduction to Cross-Platform Hybrid Mobile App Development
Introduction to Cross-Platform Hybrid Mobile App DevelopmentIntroduction to Cross-Platform Hybrid Mobile App Development
Introduction to Cross-Platform Hybrid Mobile App DevelopmentÖzcan Zafer AYAN
 
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 PhoneGapAmar Mesic
 
Introduction to hybrid application development
Introduction to hybrid application developmentIntroduction to hybrid application development
Introduction to hybrid application developmentKunjan Thakkar
 
Appcelerator Titanium Intro
Appcelerator Titanium IntroAppcelerator Titanium Intro
Appcelerator Titanium IntroNicholas Jansma
 
Tech Thursdays: Building Products
Tech Thursdays: Building ProductsTech Thursdays: Building Products
Tech Thursdays: Building ProductsHayden Bleasel
 
2011 code camp
2011 code camp2011 code camp
2011 code campimranq2
 
Top 4 Cross Platform tools for Mobile App Development
Top 4 Cross Platform tools for Mobile App DevelopmentTop 4 Cross Platform tools for Mobile App Development
Top 4 Cross Platform tools for Mobile App Developmenttechugo
 
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014Gil Irizarry
 
Development of a mobile app for Android
Development of a mobile app for AndroidDevelopment of a mobile app for Android
Development of a mobile app for AndroidAlexJReid
 
«I knew there had to be a better way to build mobile app»​
«I knew there had to be a better way to build mobile app»​«I knew there had to be a better way to build mobile app»​
«I knew there had to be a better way to build mobile app»​FDConf
 
I knew there had to be a better way to build mobile apps
I knew there had to be a better way to build mobile appsI knew there had to be a better way to build mobile apps
I knew there had to be a better way to build mobile appsAlius Petraška
 
Why Do Mobile Projects Fail?
Why Do Mobile Projects Fail?Why Do Mobile Projects Fail?
Why Do Mobile Projects Fail?Indiginox
 
appMobi HTML5 Gaming
appMobi HTML5 GamingappMobi HTML5 Gaming
appMobi HTML5 GamingAndrew Smith
 
Apache Cordova, Hybrid Application Development
Apache Cordova, Hybrid Application DevelopmentApache Cordova, Hybrid Application Development
Apache Cordova, Hybrid Application Developmentthedumbterminal
 

Similar to Phonegap - An Introduction (20)

Mobile native-hacks
Mobile native-hacksMobile native-hacks
Mobile native-hacks
 
Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011
 
Dreamweaver CS6, jQuery, PhoneGap, mobile design
Dreamweaver CS6, jQuery, PhoneGap, mobile designDreamweaver CS6, jQuery, PhoneGap, mobile design
Dreamweaver CS6, jQuery, PhoneGap, mobile design
 
Introduction to Cross-Platform Hybrid Mobile App Development
Introduction to Cross-Platform Hybrid Mobile App DevelopmentIntroduction to Cross-Platform Hybrid Mobile App Development
Introduction to Cross-Platform Hybrid Mobile App Development
 
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
 
Future of Mobile
Future of MobileFuture of Mobile
Future of Mobile
 
Getting started with PhoneGap
Getting started with PhoneGapGetting started with PhoneGap
Getting started with PhoneGap
 
Introduction to hybrid application development
Introduction to hybrid application developmentIntroduction to hybrid application development
Introduction to hybrid application development
 
Appcelerator Titanium Intro
Appcelerator Titanium IntroAppcelerator Titanium Intro
Appcelerator Titanium Intro
 
Tech Thursdays: Building Products
Tech Thursdays: Building ProductsTech Thursdays: Building Products
Tech Thursdays: Building Products
 
2011 code camp
2011 code camp2011 code camp
2011 code camp
 
Top 4 Cross Platform tools for Mobile App Development
Top 4 Cross Platform tools for Mobile App DevelopmentTop 4 Cross Platform tools for Mobile App Development
Top 4 Cross Platform tools for Mobile App Development
 
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
 
Development of a mobile app for Android
Development of a mobile app for AndroidDevelopment of a mobile app for Android
Development of a mobile app for Android
 
Intro to PhoneGap
Intro to PhoneGapIntro to PhoneGap
Intro to PhoneGap
 
«I knew there had to be a better way to build mobile app»​
«I knew there had to be a better way to build mobile app»​«I knew there had to be a better way to build mobile app»​
«I knew there had to be a better way to build mobile app»​
 
I knew there had to be a better way to build mobile apps
I knew there had to be a better way to build mobile appsI knew there had to be a better way to build mobile apps
I knew there had to be a better way to build mobile apps
 
Why Do Mobile Projects Fail?
Why Do Mobile Projects Fail?Why Do Mobile Projects Fail?
Why Do Mobile Projects Fail?
 
appMobi HTML5 Gaming
appMobi HTML5 GamingappMobi HTML5 Gaming
appMobi HTML5 Gaming
 
Apache Cordova, Hybrid Application Development
Apache Cordova, Hybrid Application DevelopmentApache Cordova, Hybrid Application Development
Apache Cordova, Hybrid Application Development
 

Recently uploaded

SQL Injection Introduction and Prevention
SQL Injection Introduction and PreventionSQL Injection Introduction and Prevention
SQL Injection Introduction and PreventionMohammed Fazuluddin
 
Microsoft365_Dev_Security_2024_05_16.pdf
Microsoft365_Dev_Security_2024_05_16.pdfMicrosoft365_Dev_Security_2024_05_16.pdf
Microsoft365_Dev_Security_2024_05_16.pdfMarkus Moeller
 
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfA Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfICS
 
IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024vaibhav130304
 
Malaysia E-Invoice digital signature docpptx
Malaysia E-Invoice digital signature docpptxMalaysia E-Invoice digital signature docpptx
Malaysia E-Invoice digital signature docpptxMok TH
 
Community is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea GouletCommunity is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea GouletAndrea Goulet
 
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Gáspár Nagy
 
Reinforcement Learning – a Rewards Based Approach to Machine Learning - Marko...
Reinforcement Learning – a Rewards Based Approach to Machine Learning - Marko...Reinforcement Learning – a Rewards Based Approach to Machine Learning - Marko...
Reinforcement Learning – a Rewards Based Approach to Machine Learning - Marko...Marko Lohert
 
Weeding your micro service landscape.pdf
Weeding your micro service landscape.pdfWeeding your micro service landscape.pdf
Weeding your micro service landscape.pdftimtebeek1
 
architecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdfarchitecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdfWSO2
 
Salesforce Introduced Zero Copy Partner Network to Simplify the Process of In...
Salesforce Introduced Zero Copy Partner Network to Simplify the Process of In...Salesforce Introduced Zero Copy Partner Network to Simplify the Process of In...
Salesforce Introduced Zero Copy Partner Network to Simplify the Process of In...CloudMetic
 
What need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java DevelopersWhat need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java DevelopersEmilyJiang23
 
JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)Max Lee
 
The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)Roberto Bettazzoni
 
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...OnePlan Solutions
 
Food Delivery Business App Development Guide 2024
Food Delivery Business App Development Guide 2024Food Delivery Business App Development Guide 2024
Food Delivery Business App Development Guide 2024Chirag Panchal
 

Recently uploaded (20)

SQL Injection Introduction and Prevention
SQL Injection Introduction and PreventionSQL Injection Introduction and Prevention
SQL Injection Introduction and Prevention
 
Microsoft365_Dev_Security_2024_05_16.pdf
Microsoft365_Dev_Security_2024_05_16.pdfMicrosoft365_Dev_Security_2024_05_16.pdf
Microsoft365_Dev_Security_2024_05_16.pdf
 
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfA Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdf
 
IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024
 
AI Hackathon.pptx
AI                        Hackathon.pptxAI                        Hackathon.pptx
AI Hackathon.pptx
 
What is an API Development- Definition, Types, Specifications, Documentation.pdf
What is an API Development- Definition, Types, Specifications, Documentation.pdfWhat is an API Development- Definition, Types, Specifications, Documentation.pdf
What is an API Development- Definition, Types, Specifications, Documentation.pdf
 
Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024
 
5 Reasons Driving Warehouse Management Systems Demand
5 Reasons Driving Warehouse Management Systems Demand5 Reasons Driving Warehouse Management Systems Demand
5 Reasons Driving Warehouse Management Systems Demand
 
Malaysia E-Invoice digital signature docpptx
Malaysia E-Invoice digital signature docpptxMalaysia E-Invoice digital signature docpptx
Malaysia E-Invoice digital signature docpptx
 
Community is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea GouletCommunity is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea Goulet
 
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
 
Reinforcement Learning – a Rewards Based Approach to Machine Learning - Marko...
Reinforcement Learning – a Rewards Based Approach to Machine Learning - Marko...Reinforcement Learning – a Rewards Based Approach to Machine Learning - Marko...
Reinforcement Learning – a Rewards Based Approach to Machine Learning - Marko...
 
Weeding your micro service landscape.pdf
Weeding your micro service landscape.pdfWeeding your micro service landscape.pdf
Weeding your micro service landscape.pdf
 
architecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdfarchitecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdf
 
Salesforce Introduced Zero Copy Partner Network to Simplify the Process of In...
Salesforce Introduced Zero Copy Partner Network to Simplify the Process of In...Salesforce Introduced Zero Copy Partner Network to Simplify the Process of In...
Salesforce Introduced Zero Copy Partner Network to Simplify the Process of In...
 
What need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java DevelopersWhat need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java Developers
 
JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)
 
The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)
 
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
 
Food Delivery Business App Development Guide 2024
Food Delivery Business App Development Guide 2024Food Delivery Business App Development Guide 2024
Food Delivery Business App Development Guide 2024
 

Phonegap - An Introduction

  • 2. Co-owner and Developer at Hello! I’m Tyler Johnston @tylerjohnst @tylerjohnst ahoyconsulting.com
  • 3. What is PhoneGap? PhoneGap is a framework for developing cross-platform mobile applications using HTML, CSS, and Javascript. It is based on the Apache Cordova project and is currently maintained by Adobe.
  • 4. Wait, I thought it was native? applications. They are displayed using a full scree
  • 5. Native App - apk/ipa/etc Native APIs Native WebView Your Code
  • 6. What Phone Features? • Accelerometer • Camera • Capture • Compass • Connection • Contacts • File • Geolocation • Media • Notification • Storage navigator.notification.vibrate(1000) Wonderful APIs
  • 7. Where Can My App Run? • iOS (iPhone/iPad) • Android • Windows Phone 7 • Blackberry OS WebWorks 7 • Symbian WRT • webOS
  • 8. • Plugin interface for accessing native code from the Javascript API. • Very active community, developing some really cool stuff. • MapKit • Flashlight • Barcode scanner • NFC • Badges • In App Purchases
  • 9. Who is using this magical framework?
  • 10. The Right Tool • PhoneGap is like any other tool, it should be used for the right job. • PhoneGap accelerates using data driven applications. • Not a great solution for apps that require significant horsepower to run.
  • 11. The Web Can Be Fast! Don’t let the original Facebook app fool you. It wasn’t HTML5 that made the app slow and clunky. It was just a bad application. Even though it is the web you have to think about performance from the beginning.
  • 12. Bring Your Own Tools PhoneGap just gives you a web browser. Bring your own tools
  • 13. page application. There are plenty of tools out ther
  • 15. Performance • Lazy load as much as you can. • Defer rendering below the “fold.” (Load 10 of the 30 sub views, then the rest.) • Precompile templates. • Only fetch required collections needed for the initial view. • _.defer/setTimeout is your friend.
  • 16. Prevent “Render Flash” • Render off screen, animate in. • Preload images. Each additional image is another network request. View will render before the image request even begins. • Even fancier to build your own local cache. • Manually disable the splash screen after your app has initialized. var path = ‘path/to/img.png’; images = {}; images[path] = new Image; images[path].src = path; $(body).append(images[path]);
  • 17. Performance • Minify and concat all of your CSS/JS. Each even though it’s a mobile app there are still network requests that are fired to local disk but with near zero latency. • Use image sprites if you can, again, the less asset requests the better the app will function and seem more “native.”
  • 18. Making Compilation Easier• Middleman (with the Middleman-Phonegap plugin) • Ruby on Rails-like asset pipeline. Supports all the sprockets and rails plugins for almost all templates. (Haml, Sass, Slim, Less) If it works with Sprockets it works with Middleman. • Almost zero configuration. Only depends on Ruby. • Minify, concat, linting. All built in.
  • 19. Track your references! Memory leaks tend to be worse on mobile as it will cause your entire app to force closed by the OS once it uses enough resident memory.
  • 20. FastClick.js ms delay on the “click” event. FastClick.js is a polyfi s the difference between a responsive app and a sl hrome for Android has removed this. FastClick acco
  • 21. Animations • All mobile phones can optimize DOM elements to be animated using the GPU. Using the GPU will cause the animations to be silky smooth. • To enable GPU acceleration on a DOM element append the following CSS rules: • GPU enabled DOM elements take significantly more memory. The best solution being to only place it on elements which you wish to perform animations on. Using the * selector will lead to lots of pain and crashes. transform: translate3d(0,0,0);
  • 22. Styling • Just because your app can be compiled and deployed to multiple platforms it does not mean all of your user interactions work across all platforms. • iOS and Android have very different ways of displaying UI. • Action bars are usually opposite. • Home buttons do different functions. • Android and Windows have physical buttons. • Loading different stylesheets at compile time is a very easy solution to solving that problem.
  • 23. Android 2.x Makes Me Cry • Really, really, really old version of Webkit. • Nasty bugs. • Really, really, really slow. • Lack of most of CSS3 basic features. • Animations • Gradients • Shadows (Box and Text)
  • 24. PhoneGap Build is Amazing • Handles compilation of your application to all available platforms. • Code signing for deployments to App Stores • Removes need for entire build environment on the local machine • Remote debugging • Hydration • Test deployments • Free for one app, $9.99 for up to 25. Included if you have
  • 25. Deploying to the App Store • Once you have your binary you can begin the process of submitting your app to the respective app store. • All signed binaries from PhoneGap build are ready to upload.
  • 26. The Google Play store is very straight forward. Setup your account and upload your signed APK and you are ready to go. There is no approval process here. By far the easiest store to deploy to.
  • 27. • First release can take upwards of a month to get approved to the store regardless of the framework used. • Apple has some strict guidelines on how your app should function. • Apps may not boot to a blank screen. So assets must be stored on the device to make sure the app loads to an interactive state. • Requiring external libraries on the initial load will cause you to fail the audit. • The code that does reside on the device must make it “interactive” enough. Apple has a rule that all apps have to “contribute” to the iPhone experience. • But they will (hopefully) approve you. Using PhoneGap is not grounds enough to reject an app. There are still a ton of reasons why they will reject you. Be diligent!
  • 28. Good luck and go make some awesome stuff! Questions? Comments?