cross platform mobile apps with html javascript and
play

Cross-Platform Mobile Apps with HTML, JavaScript, and PhoneGap - PowerPoint PPT Presentation

Cross-Platform Mobile Apps with HTML, JavaScript, and PhoneGap Christophe Coenraets @ccoenraets Resources @ccoenraets http://coenraets.org http://github.com/ccoenraets ccoenrae@adobe.com What? 3 Mobile Application Development Challenge +


  1. Cross-Platform Mobile Apps with HTML, JavaScript, and PhoneGap Christophe Coenraets @ccoenraets

  2. Resources @ccoenraets http://coenraets.org http://github.com/ccoenraets ccoenrae@adobe.com

  3. What? 3

  4. Mobile Application Development Challenge + + Objective-C Java NDK ActionScript J2ME C# C++ C++ Apple iOS Android BlackBerry QNX BlackBerry Mobile Windows Phone Nokia Samsung Bada 4

  5. The “Gap” § Package HTML/JS/CSS assets as Native Application § Expose device capabilities as JavaScript APIs consistent across platforms 5

  6. The “Gap” § PhoneGap is a “wrapper” and a “bridge” § PhoneGap is NOT : § A full-stack JavaScript framework § An architectural framework § A UI framework 6

  7. PhoneGap works with any Framework 7

  8. Access to Device Features http://phonegap.com/about/features 8

  9. What if you need more? § PhoneGap is extensible with Plugins model that enables you to write your own native logic to access via JavaScript § All phonegap APIs are plugins § There are lots of open source plugins at https://github.com/phonegap/phonegap-plugins 9

  10. DEMO: What does a PhoneGap app look like? 10

  11. Open Source § PhoneGap/Cordova was contributed to Apache by Adobe § You can get involved today! http://incubator.apache.org/cordova/ 11

  12. build.phonegap.com § Continuous deployment § No SDK required § GitHub compatible § Remote debugging

  13. Debugging with Weinre

  14. How? 14

  15. Before

  16. After: “Single Page App” <html> <head> <title>My Huge App</title> <script src="my-huge-app.js"></script> </head> </body><body> </html>

  17. Characteristics of a Single Page App § Views are built dynamically § Templates to the rescue § History handled by # or push state § Data obtained through RESTful JSON, JSONP services § Structure / Patterns needed to handle complexity 17

  18. Choosing a stack U I Architecture DOM 18

  19. Example: Backbone Directory http://github.com/ccoenraets/backbone-directory 19

  20. Backbone.js Routing 20

  21. Backbone.js Models and REST 21

  22. Employee Directory RESTful API HTTP Method URL GET api/employees GET api/employees/1 GET api/employees/1/reports POST api/employees PUT api/employees/1 DELETE api/employees/1 22

  23. Backbone.js Views 23

  24. Templates: Before 24

  25. Templates: After § Check out Mustache.js, Underscore.js, Handlebar.js, etc 25

  26. Resources @ccoenraets http://coenraets.org http://github.com/ccoenraets ccoenrae@adobe.com

Recommend


More recommend