phonegap/mobeers 2011
-me




http://brian.io
the killing field
• phonegap project background
• mobile projects in practice
• backend design concerns
• mobile web client design
• progressive enhancement to ‘native’
lets kill it
phonegap project
•   history/goals/philosphy

•   licensing
•   web standards
•   the phonegap technique (ffi / bridge)

•   platform support
•   more on the bridge: plugins
•   the future of mobile is device apis
•   device apis: sensors

•   device apis: data
•   device apis: outputs
•   present and future: a little about our roadmap

•   phonegap/build
•   perceived competition
phonegap project
•   history/goals/philosphy

•   licensing
•   web standards
•
•
       imma teach ya fuckin
    the phonegap technique (ffi / bridge)
    platform support
•
         everything aight?
    more on the bridge: plugins
•   the future of mobile is device apis
•   device apis: sensors

•   device apis: data
•   device apis: outputs
•   present and future: a little about our roadmap

•   phonegap/build
•   perceived competition
history
•   2008 got its start as a lofty summertime hack;
    gained traction as a concept @nitobi with android
    and blackberry implementations in the fall
•   2009 ppl started to pay attention when we got
    ‘rejected’ by apple; we added Symbian and webOS
    support
•   2010 IBM began tag teaming w/ Nitobi
•   2011 RIM joined: now its a gang bang
•   2011 we shipped 1.x
philosophy

• unix was (still is) right
• simple is better
• plan to fail; software is organic
• when in doubt use brute force
goals

• the web as a first class platform
• => installable web apps
• cease to exist
• => browsers adopt this model
licensing


• users: mit/bsd
• contributors: apache
free defined

• free to use
• free to modify
• free to distribute
• free to change
• free to sell
omg, how does anyone
    make money?
ever buy bottled water?
Nitobi vs PhoneGap

• we are the creators
• we are contributors
• nitobi is a software company that makes
  money writing software for ppl
• we give away as much IP as possible
web standards
• w3c has many
• whatwg seems to be working well
• bondi / jil / wac / webinos
• de facto standards ?
• mozilla getting snippy about the flailing of
  the various standards bodies: web apis and
  b2g (fuck yes.)
the phonegap technique


• colloquially called ‘the bridge’
• more correctly a FFI (foreign function
  interface)
the technique ‘splained

1. we instantiate a webview
2. we call js from the native code (‘deviceready’)
3. you can call native code from the js



        ... aaaand then we send data/
        callbacks from the native!
primary platforms

• Apple iOS >= 3 (we’ve supported since
  1.x)
• Google Android >= 1.5
• BlackBerry >= 5.x (supported since 4.2)
platforms support cont.

• HP webOS
• Nokia Symbian
• Samsung Bada
fall 2011


• Windows Phone 7
• MeeGo
further experiments

• various desktop experiments
• mozilla firefox mobile (once fennec)
• Qt is super portable (thus MeeGo)
No mobile dev platform supports as many
     deploy targets as PhoneGap.


Not even a single browser...not yet anyhow.
Adoption
contributors

• Nitobi
• IBM
• RIM
PhoneGap API


http://docs.phonegap.com
device apis

• sensors
• data
• outputs
sensors


• geo / accelerometer / gyroscope
• camera
data

• filesystem
• contacts
• media
outputs

• device screen(s)
• speakers
• speaker jack...
plugins


• everything is one
• any native api is permitted
plugins


• everything is one
• any native api is permitted
2.x roadmap!

• plugins
• performance
• security
• tooling
Plugins TODO

• packaging
• installation / removal / deps
• discovery
Performance
• benchmarking us (right now just init)
• benchmarking them (popular js libs)
• js unification and cleanup
• continual improvements to the bridge
• plugins removal will help tonnes
• data access another area of interest
security

• locking down the file://
• config.xml feature element lockdown
• code hotloading (hydra project)
• some crypto apis
• looking secure storage
tooling

• unification of mobile dev nomenclature
• standard project directory structuring
• build the tools devs are REbuilding every
  project
tooling

  • unification of mobile dev nomenclature
automate project directory structuringbitch
              the shit out of this
  • standard
  • build the tools devs are REbuilding every
     project
common tasks

• launch an emulator
• create a project
• build a project to a device / emulator
• attach a logger (console.log to stdout)
• run the mobile-spec unit test suite
A quick interlude about
     competition


• We have none.
Lets review
• philosophy
• licensing
• community adoption
• contributors
• tooling from 3rd parties
• no lock in: your app runs in a browser too
PhoneGap/Build

• We build your apps ‘in the cloud’.
• A commercial enterprise from Nitobi.
• Always free for Free/Open Source projects.
• Always 1 free private repo for developers.
hello world already!
mobile projs in practice

• define your project philosophy and goals
• value != money
• design (...not just the pretty)
• shipping
know your philosophy


• a good problem defn outlines a solution
  value proposition
 • can’t be a hero without an enemy
have a goal (not goals)


• min viable product defn
 • 1 sentence: no use of the word ‘and’
great ux happens
       iteratively

• you design always; init w/ research
 • big upfront designs fail. don’t fail.
bias

• technical bias is a normal condition
• embrace your bias; its skills you have
• embrace your existing technical debt
• be wary of anything preaching a ‘one true
  way’
the exception,
the web,
is exceptional
Good news!
• You have likely already invested in the web.
• If not, don’t worry, web tech is being taught
  in elementary schools.
• Today you have the knowledge and skills to
  build end to end systems with HTML, CSS
  and JavaScript.
shipping
• a daily activity
• writing unit tests for health and sanity
• single click builds (test/dev/release)
• distributed rcs and practices are crucial
• automate everything manual
thx


• q/a?

Mobeers waterloo-2011

  • 1.
  • 2.
  • 3.
    the killing field •phonegap project background • mobile projects in practice • backend design concerns • mobile web client design • progressive enhancement to ‘native’
  • 4.
  • 5.
    phonegap project • history/goals/philosphy • licensing • web standards • the phonegap technique (ffi / bridge) • platform support • more on the bridge: plugins • the future of mobile is device apis • device apis: sensors • device apis: data • device apis: outputs • present and future: a little about our roadmap • phonegap/build • perceived competition
  • 6.
    phonegap project • history/goals/philosphy • licensing • web standards • • imma teach ya fuckin the phonegap technique (ffi / bridge) platform support • everything aight? more on the bridge: plugins • the future of mobile is device apis • device apis: sensors • device apis: data • device apis: outputs • present and future: a little about our roadmap • phonegap/build • perceived competition
  • 7.
    history • 2008 got its start as a lofty summertime hack; gained traction as a concept @nitobi with android and blackberry implementations in the fall • 2009 ppl started to pay attention when we got ‘rejected’ by apple; we added Symbian and webOS support • 2010 IBM began tag teaming w/ Nitobi • 2011 RIM joined: now its a gang bang • 2011 we shipped 1.x
  • 8.
    philosophy • unix was(still is) right • simple is better • plan to fail; software is organic • when in doubt use brute force
  • 9.
    goals • the webas a first class platform • => installable web apps • cease to exist • => browsers adopt this model
  • 10.
  • 11.
    free defined • freeto use • free to modify • free to distribute • free to change • free to sell
  • 12.
    omg, how doesanyone make money?
  • 13.
  • 14.
    Nitobi vs PhoneGap •we are the creators • we are contributors • nitobi is a software company that makes money writing software for ppl • we give away as much IP as possible
  • 15.
    web standards • w3chas many • whatwg seems to be working well • bondi / jil / wac / webinos • de facto standards ? • mozilla getting snippy about the flailing of the various standards bodies: web apis and b2g (fuck yes.)
  • 16.
    the phonegap technique •colloquially called ‘the bridge’ • more correctly a FFI (foreign function interface)
  • 17.
    the technique ‘splained 1.we instantiate a webview 2. we call js from the native code (‘deviceready’) 3. you can call native code from the js ... aaaand then we send data/ callbacks from the native!
  • 18.
    primary platforms • AppleiOS >= 3 (we’ve supported since 1.x) • Google Android >= 1.5 • BlackBerry >= 5.x (supported since 4.2)
  • 19.
    platforms support cont. •HP webOS • Nokia Symbian • Samsung Bada
  • 20.
    fall 2011 • WindowsPhone 7 • MeeGo
  • 21.
    further experiments • variousdesktop experiments • mozilla firefox mobile (once fennec) • Qt is super portable (thus MeeGo)
  • 22.
    No mobile devplatform supports as many deploy targets as PhoneGap. Not even a single browser...not yet anyhow.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
    sensors • geo /accelerometer / gyroscope • camera
  • 28.
  • 29.
    outputs • device screen(s) •speakers • speaker jack...
  • 30.
    plugins • everything isone • any native api is permitted
  • 31.
    plugins • everything isone • any native api is permitted
  • 32.
    2.x roadmap! • plugins •performance • security • tooling
  • 33.
    Plugins TODO • packaging •installation / removal / deps • discovery
  • 34.
    Performance • benchmarking us(right now just init) • benchmarking them (popular js libs) • js unification and cleanup • continual improvements to the bridge • plugins removal will help tonnes • data access another area of interest
  • 35.
    security • locking downthe file:// • config.xml feature element lockdown • code hotloading (hydra project) • some crypto apis • looking secure storage
  • 36.
    tooling • unification ofmobile dev nomenclature • standard project directory structuring • build the tools devs are REbuilding every project
  • 37.
    tooling •unification of mobile dev nomenclature automate project directory structuringbitch the shit out of this • standard • build the tools devs are REbuilding every project
  • 38.
    common tasks • launchan emulator • create a project • build a project to a device / emulator • attach a logger (console.log to stdout) • run the mobile-spec unit test suite
  • 39.
    A quick interludeabout competition • We have none.
  • 40.
    Lets review • philosophy •licensing • community adoption • contributors • tooling from 3rd parties • no lock in: your app runs in a browser too
  • 41.
    PhoneGap/Build • We buildyour apps ‘in the cloud’. • A commercial enterprise from Nitobi. • Always free for Free/Open Source projects. • Always 1 free private repo for developers.
  • 42.
  • 43.
    mobile projs inpractice • define your project philosophy and goals • value != money • design (...not just the pretty) • shipping
  • 44.
    know your philosophy •a good problem defn outlines a solution value proposition • can’t be a hero without an enemy
  • 45.
    have a goal(not goals) • min viable product defn • 1 sentence: no use of the word ‘and’
  • 46.
    great ux happens iteratively • you design always; init w/ research • big upfront designs fail. don’t fail.
  • 47.
    bias • technical biasis a normal condition • embrace your bias; its skills you have • embrace your existing technical debt • be wary of anything preaching a ‘one true way’
  • 48.
  • 49.
    Good news! • Youhave likely already invested in the web. • If not, don’t worry, web tech is being taught in elementary schools. • Today you have the knowledge and skills to build end to end systems with HTML, CSS and JavaScript.
  • 50.
    shipping • a dailyactivity • writing unit tests for health and sanity • single click builds (test/dev/release) • distributed rcs and practices are crucial • automate everything manual
  • 51.