building mobile apps with javascript and php

22
Mobile apps with JavaScript and PHP Ed Finkler Fictive Kin @funkatron http://funkatron.com http://joind.in/3389 Thursday, May 26, 2011

Upload: funkatron

Post on 13-May-2015

9.513 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Building mobile apps with JavaScript and PHP

Mobile apps with JavaScript and PHP

Ed Finkler

Fictive Kin

@funkatron

http://funkatron.com

http://joind.in/3389

Thursday, May 26, 2011

Page 2: Building mobile apps with JavaScript and PHP

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

Page 3: Building mobile apps with JavaScript and PHP

• 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

Page 4: Building mobile apps with JavaScript and PHP

Most options are JavaScript + HTML + CSS

Thursday, May 26, 2011

Page 5: Building mobile apps with JavaScript and PHP

• iOS

• Android

• webOS

• BlackBerry

• Symbian

Strong webkit implementations on most platforms

Thursday, May 26, 2011

Page 6: Building mobile apps with JavaScript and PHP

• limits your access to device functionality

• far easier to update

Deploy on server:

Thursday, May 26, 2011

Page 7: Building mobile apps with JavaScript and PHP

• access more platform-specific functionality

• updating can be a pain

Deploy on device

Thursday, May 26, 2011

Page 8: Building mobile apps with JavaScript and PHP

• HP Palm webOS special case – all apps build on JS/HTML/CSS

Shim libraries bridge JS and device functionality

Thursday, May 26, 2011

Page 9: Building mobile apps with JavaScript and PHP

• PhoneGap

• Titanium Mobile

Options for device deployment

Thursday, May 26, 2011

Page 10: Building mobile apps with JavaScript and PHP

• 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

Page 11: Building mobile apps with JavaScript and PHP

• 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

Page 12: Building mobile apps with JavaScript and PHP

• 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

Page 13: Building mobile apps with JavaScript and PHP

• 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

Page 14: Building mobile apps with JavaScript and PHP

• 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

Page 15: Building mobile apps with JavaScript and PHP

Spaz in Enyo

• Dev in Chrome

• Test with emulator VM

• We can build really fast with this

Thursday, May 26, 2011

Page 16: Building mobile apps with JavaScript and PHP

• 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

Page 17: Building mobile apps with JavaScript and PHP

• 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

Page 18: Building mobile apps with JavaScript and PHP

FRAPI

• A great framework for rapidly building RESTful APIs

• Using it at Gimme Bar

Thursday, May 26, 2011

Page 19: Building mobile apps with JavaScript and PHP

Examples!

• WildGarlic

• in Jo

• in jQueryMobile + Backbone.js

• in Enyo

Thursday, May 26, 2011

Page 20: Building mobile apps with JavaScript and PHP

Examples!

• FRAPI

• api.getspaz.com

Thursday, May 26, 2011

Page 21: Building mobile apps with JavaScript and PHP

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

Page 22: Building mobile apps with JavaScript and PHP

Q&A

• Axe me

• http://joind.in/3389

Thursday, May 26, 2011