Apache Cordova,
Hybrid Application Development
Mark Terry
Standard introduction
● Developer for 18 years, mostly in web.
● Currently working at Holiday Extras, Kent.
● Big fan of mobile.
● Not really a big fan of Javascript.
Brief History
● Originally “PhoneGap” made by Nitobi in 2009
● Adobe bought Nitobi in 2011
● Adobe contributed the source to the Apache
Software Foundation, and changed name.
● Now powers Adobe PhoneGap and others.
● Adobe provides extra functionality such as its
build service.
● Regular updates.
Who uses it?
● Microsoft
● Adobe
● IBM
● Salesforce
● Facebook
● Wikipedia
● RIM
● BBC
● Holiday extras!
What does it give you?
● Boilerplate native container application
containing a web view.
● CLI to build, emulate and run your application.
● Javascript interface to any native code.
● Native plugin repository.
Cover versions
● Adobe Phonegap
● Intel XDK
● Appery.io
● AppGyver Steroids
● Iconic
Platforms and Plugins
● Android
● iOS
● BlackBerry 10
● Windows Phone 8
● Amazon Fire OS
● Firefox OS
● Ubuntu Touch
● Windows
● Tizen
● ...
● Battery Status
● Camera
● Contacts
● Device Motion and Orientation
● File System
● Geolocation
● Globalization
● Media Capture
● Network Information
● Vibration
● And more....
Your browser is a platform!
● Apps are developed in your browser.
● Native plugins won't work but they can be
emulated automatically.
Why should you use it?
● Able to use standard web technologies.
● And nearly a similar toolset.
● Quick to release on multiple platforms.
● DRY / Code sharing.
Getting started
● Select target devices based on OS version.
● Single page app is the norm.
● Client heavy, with offline functionality.
● Cordova app can be nested into an existing
native app.
● Use a JS framework that you know.
● JS helpers: rachet, hammerjs, jquerymobile,
etc..
It's not all roses
● Need a some native dev experience.
● Still encounter differing device behaviour.
● Different platform expectations.
● Contributed plugins can be of varying quality.
Questions
● http://cordova.apache.org/
● #cordova #phonegap on IRC
● http://about.me/m.terry
Hack day project
http://production.fixie-app.divshot.io/

Apache Cordova, Hybrid Application Development

  • 1.
    Apache Cordova, Hybrid ApplicationDevelopment Mark Terry
  • 2.
    Standard introduction ● Developerfor 18 years, mostly in web. ● Currently working at Holiday Extras, Kent. ● Big fan of mobile. ● Not really a big fan of Javascript.
  • 3.
    Brief History ● Originally“PhoneGap” made by Nitobi in 2009 ● Adobe bought Nitobi in 2011 ● Adobe contributed the source to the Apache Software Foundation, and changed name. ● Now powers Adobe PhoneGap and others. ● Adobe provides extra functionality such as its build service. ● Regular updates.
  • 4.
    Who uses it? ●Microsoft ● Adobe ● IBM ● Salesforce ● Facebook ● Wikipedia ● RIM ● BBC ● Holiday extras!
  • 5.
    What does itgive you? ● Boilerplate native container application containing a web view. ● CLI to build, emulate and run your application. ● Javascript interface to any native code. ● Native plugin repository.
  • 6.
    Cover versions ● AdobePhonegap ● Intel XDK ● Appery.io ● AppGyver Steroids ● Iconic
  • 7.
    Platforms and Plugins ●Android ● iOS ● BlackBerry 10 ● Windows Phone 8 ● Amazon Fire OS ● Firefox OS ● Ubuntu Touch ● Windows ● Tizen ● ... ● Battery Status ● Camera ● Contacts ● Device Motion and Orientation ● File System ● Geolocation ● Globalization ● Media Capture ● Network Information ● Vibration ● And more....
  • 8.
    Your browser isa platform! ● Apps are developed in your browser. ● Native plugins won't work but they can be emulated automatically.
  • 9.
    Why should youuse it? ● Able to use standard web technologies. ● And nearly a similar toolset. ● Quick to release on multiple platforms. ● DRY / Code sharing.
  • 10.
    Getting started ● Selecttarget devices based on OS version. ● Single page app is the norm. ● Client heavy, with offline functionality. ● Cordova app can be nested into an existing native app. ● Use a JS framework that you know. ● JS helpers: rachet, hammerjs, jquerymobile, etc..
  • 11.
    It's not allroses ● Need a some native dev experience. ● Still encounter differing device behaviour. ● Different platform expectations. ● Contributed plugins can be of varying quality.
  • 12.
    Questions ● http://cordova.apache.org/ ● #cordova#phonegap on IRC ● http://about.me/m.terry
  • 13.

Editor's Notes

  • #2 Hello!
  • #3 I've got starting on writing mobile apps in the past, but have been dismayed that I would have to write the same app several times just so all my friends could run it. This took me back to packaging up visual basic apps for different versions of windows many years ago. Not a good place. Using web technologies Javascript is what we have at the moment that runs in the client cross browser, so we have to live with it. ES6 is looking good though. Don't judge me :-)
  • #4 Once an open source project becomes part of the apache foundation, you know there is some development behind it, with a good issue reporting, feature release and community backing it. We need to mention phonegap as you will come across mentions of it in blogs and stack overflow questions etc. when researching. The build service allows you to deploy apps for platforms you don't have. For example an iOS app without needing to own a mac. In short, they are similar but not the same. Cordova's goal is to become redundant, hopefully all browsers will catch up with all the required native technology and we can just use HTML5 only! New point releases nearly every month!
  • #5 Here are some of the brands you will recognise Microsoft and RIM played a big hand in creating the native platform brings that allows cordova to work so there is some good backing behind the project.
  • #6 A webview is a native component which is a mini browser in itself. Cordova creates a native container or separate app for every supported platform you need. A cordova app is just a HTML app running from inside a native app. Doesn't sound like a lot, but we have the freedom to write an app how we like. Using the provided CLI alongside platform tools, you can build release ready apps without the need to start xcode, eclipse or android studio. There are projects available that allow you to download your updated JS over the web when you app requires updating so you don't even need to release new app versions.
  • #7 These products all use cordova as their underlying technology. Intel XDK has built in game support for gamepads and rendering libraries. Appery, allows you to develop in the cloud. AppGyver adds extra tooling and their own UI framework. Iconic adds in the angular js framework.
  • #8 Tizen, open source os that can run in cars, phones, wearable devices – Samsung Gear S watch Samsung Z1 phone released at the start of the year in India uses it. These plugins are provided by cordova and are updated regularly so you can rely on them. You can write your own plugins and then upload them to github etc. to install and share, in a similar way to npm or bower. You can think of plugins as missing browser features or native polyfills.
  • #9 For example. If you have an accelerometer plugin in your browser it could simulate some predictable motion, rather than just failing or not sending any motion events. It is up the author of a plugin to decide which platforms they support.
  • #10 Css, less, HTML5, coffescript, Javascript, and libraries such as momentjs. You will most likely have developer(s) with this knowledge already. Frameworks such as backbone or angular etc.. Can use your current web dev editor, to keep devs happy. Can debug in the browser on modern devices. Releasing on multiple platforms at once take minutes, just a matter of typing in a few commands and navigating the particular app stores release process. Dont repeat yourself, this is a big win for me, you will probably have a lot of styles, layout and logic that can be reused in an app that can speed up development further.
  • #11 Working with new devices is straight forward, as you go back through the older versions support for features you need might be lacking. Polyfilling or emulating features might not be worthwhile. Multiple single page apps can be used in one cordova app, or more than one cordova app can be nested inside a single native app.
  • #12 IOS users expect apps to work in a certain way as do android users, which way will your app work? Will you alter the app depending on platform or strike some middle ground. Eg, the hardware back button on the android. There are many plugins created by users, mostly on Github, some are designed for previous cordova versions, not being maintained well.
  • #13 There are normally some helpful people on irc.