Date post: | 13-May-2015 |
Category: |
Technology |
Upload: | funkatron |
View: | 9,507 times |
Download: | 2 times |
Mobile apps with JavaScript and PHP
Ed Finkler
Fictive Kin
@funkatron
http://funkatron.com
http://joind.in/3389
Thursday, May 26, 2011
Me
• I work on Gimme Bar (http://gimmebar.com)
• I work on Spaz (http://getspaz.com)
• Sometimes I write PHP, sometimes I write JavaScript
Thursday, May 26, 2011
• Offers the best option for cross-platform mobile dev
• strong, diverse community, good tools
• deployable from server or locally-installed
Why JavaScript?
Thursday, May 26, 2011
Most options are JavaScript + HTML + CSS
Thursday, May 26, 2011
• iOS
• Android
• webOS
• BlackBerry
• Symbian
Strong webkit implementations on most platforms
Thursday, May 26, 2011
• limits your access to device functionality
• far easier to update
Deploy on server:
Thursday, May 26, 2011
• access more platform-specific functionality
• updating can be a pain
Deploy on device
Thursday, May 26, 2011
• HP Palm webOS special case – all apps build on JS/HTML/CSS
Shim libraries bridge JS and device functionality
Thursday, May 26, 2011
• PhoneGap
• Titanium Mobile
Options for device deployment
Thursday, May 26, 2011
• Wrapper + shim layer – very basic, works on several platforms
• Much more flexible; lets you pick any approach for building the app
• Potentially slower; less access to platform-specific APIs
• http://www.phonegap.com/
PhoneGap
Thursday, May 26, 2011
• Accelerometer
• Camera
• Compass
• Contacts
• Device Info
• Native Events
• File
• Geoloc
• Media
• Network connectivity
• Notications
• Storage
• Plugins can add additional https://github.com/purplecabbage/phonegap-plugins
PhoneGap device API support (varies by device)
Thursday, May 26, 2011
• Lots of JS DOM frameworks work well in PhoneGap
• jo (http://joapp.com)
• jQuery Mobile (http://jquerymobile.com)
• Enyo (http://developer.palm.com/)
• Sencha Touch (http://www.sencha.com/products/touch/)
• Many more!
PhoneGap + Your preferred approach
Thursday, May 26, 2011
• Full-stack, access to native UI components via JavaScript. Works on Android and iOS.
• Potentially faster
• Anecdotally, can be kinda buggy
• http://www.appcelerator.com/
Titanium Mobile
Thursday, May 26, 2011
• Similar base support to PhoneGap, plus
• Android Calendar
• Facebook APIs
• Map
• XML
• Yahoo APIs
• Plugins can add additional functionality; can be written in native code
Titanium Mobile device API support
Thursday, May 26, 2011
Spaz in Enyo
• Dev in Chrome
• Test with emulator VM
• We can build really fast with this
Thursday, May 26, 2011
• You can build your server side stuff lots of ways
• Pick what works for you and STFU
• Some simple FWs
• koi
• slim
• breeze
• limonade
• glue
• flight
Server Side: PHP
Thursday, May 26, 2011
• Make a simple HTTP call w/ basic query data
• respond with JSON structure
• https://www.ibm.com/developerworks/webservices/library/ws-restful/
RESTful implementations with JSON responses work best
Thursday, May 26, 2011
FRAPI
• A great framework for rapidly building RESTful APIs
• Using it at Gimme Bar
Thursday, May 26, 2011
Examples!
• WildGarlic
• in Jo
• in jQueryMobile + Backbone.js
• in Enyo
Thursday, May 26, 2011
Examples!
• FRAPI
• api.getspaz.com
Thursday, May 26, 2011
Code from examples
• http://getfrapi.com
• https://github.com/funkatron/wildgarlic
• https://github.com/funkatron/WildGarlic-jqmobile
• https://github.com/funkatron/Spaz-Web-APIs
Thursday, May 26, 2011
Q&A
• Axe me
• http://joind.in/3389
Thursday, May 26, 2011