From http://adapt.to/2014/en/schedule/mobile-app-development-with-apache-cordova-and-aem.html:
This talk will focus on patterns and tools for bringing your Sling and web expertise to the world of mobile applications. Centre stage will be Cordova, an Apache project with PhoneGap origins - built to enable cross-platform mobile apps and in turn, advance the open web. I'll introduce techniques for solving common use cases with Sling as the backend, complete with sample code to get you started today. Lastly, we'll take a look at the integration of Cordova and AEM (affectionately known as PhoneGap Enterprise) featured in the 6.0 release.
10. Enter Hybrid Applications
§ Web app wrapped in a device native shell
§ Write once, run everywhere*
§ *aka “the promised land”
Na3ve
SDKs
adaptTo() 2014 10
11. But… Web vs. Native!
§ Both built on the same set of technologies
§ Web capabilities sufficient for most apps
“If a browser doesn’t do something its not because it can’t;
it’s just because we haven’t gotten around to implementing that part yet.”
-Brian LeRoux
adaptTo() 2014 11
12. But the web can’t…
§ Access device features, like:
§ Camera
§ Device motion
§ File system
§ Location
§ Provide background notifications
§ Render without connectivity
§ or even poor connectivity
§ Or can it?
adaptTo() 2014 12
13. Enter Apache Cordova
Build apps with web tech you know and love
adaptTo() 2014 13
14. Cordova
§ A cross-platform app framework
§ Initially PhoneGap, created by Nitobi
§ Donated to ASF in 2011 as Cordova
§ of which PhoneGap is a distribution
adaptTo() 2014 14
15. Cordova
§ Supported platforms
§ iOS
§ Android
§ BB10
§ WP7, WP8, Windows 8
§ Amazon Fire OS
§ Tizen
§ and more…
adaptTo() 2014 15
17. Cordova CLI
§ Command line interface features
§ Bootstrap a new app
§ build/install/run app on a
specific platform
§ Locally
or
via
PhoneGap
build
§ Manage plugins
adaptTo() 2014 17
19. Cordova CLI at a glance
§ Create your app:
cordova create helloAdaptTo
§ Add a platform:
cd helloAdaptTo
cordova platform add ios
§ Run your app on a simulator:
cordova emulate ios
adaptTo() 2014 19
20. Cordova + Sling
§ Goals:
§ Repurpose existing content
§ Fetch & present data with
minimum server side
customization
§ Authenticate with the server
adaptTo() 2014 20
21. Cordova + Sling
§ Bonus goals
§ Post content from device
§ Be indistinguishable from
a native app
§ Offline access to content
adaptTo() 2014 21