SlideShare a Scribd company logo
Cross-Development for
  Android & Other
   Mobile Platforms
                Prof. Jeff Sonstein
  Dept. of Information Sciences & Technologies
       Rochester Institute of Technology
                  jxsast@rit.edu
Why This Talk

• Coding is easy, design is hard
• Maintaining multiple development teams &
  codebases is costly & error-prone
• Users appreciate a reasonably consistent
  experience across platforms
Designing for Mobile
1.     design for One Web

2.     rely on standards

3.     avoid known hazards

4.     be cautious of device limitations

5.     optimize navigation

6.     check graphics and colors

7.     keep it small

8.     use network sparingly

9.     help & guide user input

10. think of users on-the-go

     http://www.w3.org/2007/02/mwbp_flip_cards.html
WebApps, Native Apps,
& Cross-Compilation
• WebApps: browser context, served over
  Web, written in HTML/CSS/JavaScript
• Native Apps: written in higher-level
  language specific to that platform
• Cross-compilers: advantages of WebApps
  but install as native apps
Phonegap & Mobile
             Devices
•   PhoneGap is a tool which allows you to compose
    once (using HTML/CSS/JavaScript) then cross-
    compile and deploy to many different target
    platforms:
    •   iOs

    •   Android

    •   Blackberry

    •   webOS

    •   Windows Mobile

    •   Symbian
Installing Phonegap

•   see http://www.ist.rit.edu/~jxs/classes/2010_Winter/MobileFoundations/01_week/
    phonegapStart.html for more details

•   download and install Android SDKs

•   download PhoneGap

•   unarchive it into an arbitrary directory

•   make sure Android tools directory is in your $PATH (on my system: /Users/
    jeffs/development/android/tools)
Compiling & Deploying
  Phonegap Apps
•   open a terminal window and navigate to appropriate PhoneGap directory
    (on my system: /Users/jeffs/development/phonegap/phonegap-android/)

•   compile with droidgap tool (see details page on previous slide)

•   open second terminal window and start Android emulator or plug in
    Android device

•   change directory to wherever you told droidgap to put the generated code

•   issue command ant debug install
Demo


• exit to live demo
Phonegap Docs &
      Materials Online
•   common functionality: http://docs.phonegap.com/

•   tutorials: http://wiki.phonegap.com/w/page/
    16494772/FrontPage

•   google group: http://groups.google.com/group/
    phonegap

•   source repository: https://github.com/phonegap

•   development tools: http://www.phonegap.com/tools/
Phonegap API
            Capabilities

•   High-level common mobile functionality API

•   Support for HTML5 & CSS3
Common Functionality:
   Accelerometer
• Captures device motion in X/Y/Z
  directions
• Methods:
 • getCurrentAcceleration
 • watchAcceleration
 • clearWatch
Common Functionality:
     Camera

• Provides access to default camera
• Method:
 • getPicture
Common Functionality:
    Compass

• Obtains direction device is pointing
• Methods:
 • getCurrentHeading
 • watchHeading
 • clearWatch
Common Functionality:
    Contacts

• Provides access to device contacts database
• Methods:
 • create
 • find
Common Functionality:
     Device
• Gather device hardware/software info
• Properties:
 • name
 • phonegap (gets version)
 • platform
 • uuid
 • version
Common Functionality:
     Events

• Fires when Phonegap has loaded
• Event:
 • deviceready
Common Functionality:
    File System
• Provides access to the device file system
• Objects:
 • FileReader
 • FileWriter
 • FileError
Common Functionality:
   Geolocation

• Provides access to the GPS sensor
• Methods:
 • getCurrentPosition
 • watchPosition
 • clearWatch
Common Functionality:
     Media
• Provides ability to record and play back
  audio
• Methods:
  •   getCurrentPosition

  •   getDuration

  •   play/pause

  •   release

  •   start/stop record

  •   stop
Common Functionality:
    Network

• Access both cellular & wifi connection info
• Method:
 • isReachable
Common Functionality:
   Notifications
• Visual, audible, & tactile device notifications
• Methods:
 • alert
 • confirm
 • beep
 • vibrate
Common Functionality:
     Storage
• Access device database implementation
• Method:
 • openDatabase
 • Database object manipulation sub-
    methods
HTML5 localStorage

• name/value pairs (think associative array)
• persists between sessions
• example:
  •   http://www.ist.rit.edu/~jxs/classes/2010_Winter/
      MobileFoundations/05_week/storage.html
CSS3 & Webkit

• Support table:
  •   http://westciv.com/wiki/
      Experimental_CSS_compatibility_table

• Tutorial:
  •   http://www.cardeo.ca/css3-handbook/
Major CSS
Summary

• Design design design, then code once
• Maintaining a single design team and one
  codebase and having a unified UX across
  platforms is generally more efficient
• Leveraging your Web developer’s skills is
  generally A Good Idea
Exercise
• Download and install Android development
  tools
• Download and install PhoneGap
• Compile & test/deploy example app from
  PhoneGap directory
• Write, compile, & test/deploy your own
  HelloWorld app
Cross-Development for
  Android & Other
   Mobile Platforms
                Prof. Jeff Sonstein
  Dept. of Information Sciences & Technologies
       Rochester Institute of Technology
                  jxsast@rit.edu

More Related Content

Similar to Android development workshop

The Mobile Web Revealed For The Java Developer
The Mobile Web Revealed For The Java DeveloperThe Mobile Web Revealed For The Java Developer
The Mobile Web Revealed For The Java Developer
balunasj
 
Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)
Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)
Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)
Ryan Cuprak
 
PhoneGap at Facebook Mobile Hack
PhoneGap at Facebook Mobile HackPhoneGap at Facebook Mobile Hack
PhoneGap at Facebook Mobile Hack
PhoneGap
 
Developing Windows Phone 8 apps using PhoneGap
Developing Windows Phone 8 apps using PhoneGapDeveloping Windows Phone 8 apps using PhoneGap
Developing Windows Phone 8 apps using PhoneGap
Amar Mesic
 
PhoneGap/Cordova
PhoneGap/CordovaPhoneGap/Cordova
PhoneGap/Cordova
Mihai Corlan
 
Mobile Devices
Mobile DevicesMobile Devices
Mobile Devices
Ynon Perek
 
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There TodayHTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
davyjones
 
Mobeers waterloo-2011
Mobeers waterloo-2011Mobeers waterloo-2011
Mobeers waterloo-2011
Brian LeRoux
 
Txjs
TxjsTxjs
[2015/2016] Apache Cordova
[2015/2016] Apache Cordova[2015/2016] Apache Cordova
[2015/2016] Apache Cordova
Ivano Malavolta
 
#Code2Create:: Introduction to App Development in Flutter with Dart
#Code2Create:: Introduction to App Development in Flutter with Dart#Code2Create:: Introduction to App Development in Flutter with Dart
#Code2Create:: Introduction to App Development in Flutter with Dart
GDGKuwaitGoogleDevel
 
Future of Mobile
Future of MobileFuture of Mobile
Future of Mobile
Brian LeRoux
 
Anatomy of an HTML 5 mobile web app
Anatomy of an HTML 5 mobile web app Anatomy of an HTML 5 mobile web app
Anatomy of an HTML 5 mobile web app
Ivano Malavolta
 
Introduction to Phonegap
Introduction to PhonegapIntroduction to Phonegap
Introduction to Phonegap
Andrei Firoiu
 
1. course introduction
1. course introduction1. course introduction
1. course introduction
Svitlana Sikora
 
An overview of mobile html + java script frameworks
An overview of mobile html + java script frameworksAn overview of mobile html + java script frameworks
An overview of mobile html + java script frameworks
Sasha dos Santos
 
Phonegap facebook- plugin
Phonegap facebook- pluginPhonegap facebook- plugin
Phonegap facebook- plugin
Steve Gill
 
Using Javascript in today's world
Using Javascript in today's worldUsing Javascript in today's world
Using Javascript in today's world
Sudar Muthu
 
Building Mobile Cross-Platform Apps with HTML5, jQuery Mobile & PhoneGap
Building Mobile Cross-Platform Apps with HTML5, jQuery Mobile & PhoneGapBuilding Mobile Cross-Platform Apps with HTML5, jQuery Mobile & PhoneGap
Building Mobile Cross-Platform Apps with HTML5, jQuery Mobile & PhoneGap
Nick Landry
 
Phoenix Emulator PPT
Phoenix Emulator PPTPhoenix Emulator PPT
Phoenix Emulator PPT
Vineet Kumar
 

Similar to Android development workshop (20)

The Mobile Web Revealed For The Java Developer
The Mobile Web Revealed For The Java DeveloperThe Mobile Web Revealed For The Java Developer
The Mobile Web Revealed For The Java Developer
 
Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)
Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)
Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)
 
PhoneGap at Facebook Mobile Hack
PhoneGap at Facebook Mobile HackPhoneGap at Facebook Mobile Hack
PhoneGap at Facebook Mobile Hack
 
Developing Windows Phone 8 apps using PhoneGap
Developing Windows Phone 8 apps using PhoneGapDeveloping Windows Phone 8 apps using PhoneGap
Developing Windows Phone 8 apps using PhoneGap
 
PhoneGap/Cordova
PhoneGap/CordovaPhoneGap/Cordova
PhoneGap/Cordova
 
Mobile Devices
Mobile DevicesMobile Devices
Mobile Devices
 
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There TodayHTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
 
Mobeers waterloo-2011
Mobeers waterloo-2011Mobeers waterloo-2011
Mobeers waterloo-2011
 
Txjs
TxjsTxjs
Txjs
 
[2015/2016] Apache Cordova
[2015/2016] Apache Cordova[2015/2016] Apache Cordova
[2015/2016] Apache Cordova
 
#Code2Create:: Introduction to App Development in Flutter with Dart
#Code2Create:: Introduction to App Development in Flutter with Dart#Code2Create:: Introduction to App Development in Flutter with Dart
#Code2Create:: Introduction to App Development in Flutter with Dart
 
Future of Mobile
Future of MobileFuture of Mobile
Future of Mobile
 
Anatomy of an HTML 5 mobile web app
Anatomy of an HTML 5 mobile web app Anatomy of an HTML 5 mobile web app
Anatomy of an HTML 5 mobile web app
 
Introduction to Phonegap
Introduction to PhonegapIntroduction to Phonegap
Introduction to Phonegap
 
1. course introduction
1. course introduction1. course introduction
1. course introduction
 
An overview of mobile html + java script frameworks
An overview of mobile html + java script frameworksAn overview of mobile html + java script frameworks
An overview of mobile html + java script frameworks
 
Phonegap facebook- plugin
Phonegap facebook- pluginPhonegap facebook- plugin
Phonegap facebook- plugin
 
Using Javascript in today's world
Using Javascript in today's worldUsing Javascript in today's world
Using Javascript in today's world
 
Building Mobile Cross-Platform Apps with HTML5, jQuery Mobile & PhoneGap
Building Mobile Cross-Platform Apps with HTML5, jQuery Mobile & PhoneGapBuilding Mobile Cross-Platform Apps with HTML5, jQuery Mobile & PhoneGap
Building Mobile Cross-Platform Apps with HTML5, jQuery Mobile & PhoneGap
 
Phoenix Emulator PPT
Phoenix Emulator PPTPhoenix Emulator PPT
Phoenix Emulator PPT
 

Recently uploaded

Manual ISH (International Society of Hypertension)
Manual ISH (International Society of Hypertension)Manual ISH (International Society of Hypertension)
Manual ISH (International Society of Hypertension)
bagmai
 
原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样
原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样
原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样
hw2xf1m
 
一比一原版(UoN毕业证书)纽卡斯尔大学毕业证如何办理
一比一原版(UoN毕业证书)纽卡斯尔大学毕业证如何办理一比一原版(UoN毕业证书)纽卡斯尔大学毕业证如何办理
一比一原版(UoN毕业证书)纽卡斯尔大学毕业证如何办理
f22b6g9c
 
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
k7nm6tk
 
一比一原版亚利桑那大学毕业证(UA毕业证书)如何办理
一比一原版亚利桑那大学毕业证(UA毕业证书)如何办理一比一原版亚利桑那大学毕业证(UA毕业证书)如何办理
一比一原版亚利桑那大学毕业证(UA毕业证书)如何办理
21uul8se
 
modular-kitchen home plan civil engineering.pdf
modular-kitchen home plan civil engineering.pdfmodular-kitchen home plan civil engineering.pdf
modular-kitchen home plan civil engineering.pdf
RashmitaSwain3
 
Getting Data Ready for Culture Hack by Neontribe
Getting Data Ready for Culture Hack by NeontribeGetting Data Ready for Culture Hack by Neontribe
Getting Data Ready for Culture Hack by Neontribe
Harry Harrold
 
一比一原版(LaTrobe毕业证书)拉筹伯大学毕业证如何办理
一比一原版(LaTrobe毕业证书)拉筹伯大学毕业证如何办理一比一原版(LaTrobe毕业证书)拉筹伯大学毕业证如何办理
一比一原版(LaTrobe毕业证书)拉筹伯大学毕业证如何办理
67n7f53
 
UXpert_Report (UALR Mapping Renewal 2022).pdf
UXpert_Report (UALR Mapping Renewal 2022).pdfUXpert_Report (UALR Mapping Renewal 2022).pdf
UXpert_Report (UALR Mapping Renewal 2022).pdf
anthonylin333
 
一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样
一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样
一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样
3vgr39kx
 
欧洲杯买球-欧洲杯买球买球网好的网站-欧洲杯买球哪里有正规的买球网站|【​网址​🎉ac123.net🎉​】
欧洲杯买球-欧洲杯买球买球网好的网站-欧洲杯买球哪里有正规的买球网站|【​网址​🎉ac123.net🎉​】欧洲杯买球-欧洲杯买球买球网好的网站-欧洲杯买球哪里有正规的买球网站|【​网址​🎉ac123.net🎉​】
欧洲杯买球-欧洲杯买球买球网好的网站-欧洲杯买球哪里有正规的买球网站|【​网址​🎉ac123.net🎉​】
jafiradnan336
 
International Upcycling Research Network advisory board meeting 4
International Upcycling Research Network advisory board meeting 4International Upcycling Research Network advisory board meeting 4
International Upcycling Research Network advisory board meeting 4
Kyungeun Sung
 
Graphic Design Tools and Software .pptx
Graphic Design Tools and Software   .pptxGraphic Design Tools and Software   .pptx
Graphic Design Tools and Software .pptx
Virtual Real Design
 
CocaCola_Brand_equity_package_2012__.pdf
CocaCola_Brand_equity_package_2012__.pdfCocaCola_Brand_equity_package_2012__.pdf
CocaCola_Brand_equity_package_2012__.pdf
PabloMartelLpez
 
哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样
哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样
哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样
qo1as76n
 
Heuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdfHeuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdf
Jaime Brown
 
Discovering the Best Indian Architects A Spotlight on Design Forum Internatio...
Discovering the Best Indian Architects A Spotlight on Design Forum Internatio...Discovering the Best Indian Architects A Spotlight on Design Forum Internatio...
Discovering the Best Indian Architects A Spotlight on Design Forum Internatio...
Designforuminternational
 
AHMED TALAAT ARCHITECTURE PORTFOLIO .pdf
AHMED TALAAT ARCHITECTURE PORTFOLIO .pdfAHMED TALAAT ARCHITECTURE PORTFOLIO .pdf
AHMED TALAAT ARCHITECTURE PORTFOLIO .pdf
talaatahm
 
一比一原版(CSU毕业证书)查尔斯特大学毕业证如何办理
一比一原版(CSU毕业证书)查尔斯特大学毕业证如何办理一比一原版(CSU毕业证书)查尔斯特大学毕业证如何办理
一比一原版(CSU毕业证书)查尔斯特大学毕业证如何办理
67n7f53
 
一比一原版美国哥伦比亚大学毕业证Columbia成绩单一模一样
一比一原版美国哥伦比亚大学毕业证Columbia成绩单一模一样一比一原版美国哥伦比亚大学毕业证Columbia成绩单一模一样
一比一原版美国哥伦比亚大学毕业证Columbia成绩单一模一样
881evgn0
 

Recently uploaded (20)

Manual ISH (International Society of Hypertension)
Manual ISH (International Society of Hypertension)Manual ISH (International Society of Hypertension)
Manual ISH (International Society of Hypertension)
 
原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样
原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样
原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样
 
一比一原版(UoN毕业证书)纽卡斯尔大学毕业证如何办理
一比一原版(UoN毕业证书)纽卡斯尔大学毕业证如何办理一比一原版(UoN毕业证书)纽卡斯尔大学毕业证如何办理
一比一原版(UoN毕业证书)纽卡斯尔大学毕业证如何办理
 
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
 
一比一原版亚利桑那大学毕业证(UA毕业证书)如何办理
一比一原版亚利桑那大学毕业证(UA毕业证书)如何办理一比一原版亚利桑那大学毕业证(UA毕业证书)如何办理
一比一原版亚利桑那大学毕业证(UA毕业证书)如何办理
 
modular-kitchen home plan civil engineering.pdf
modular-kitchen home plan civil engineering.pdfmodular-kitchen home plan civil engineering.pdf
modular-kitchen home plan civil engineering.pdf
 
Getting Data Ready for Culture Hack by Neontribe
Getting Data Ready for Culture Hack by NeontribeGetting Data Ready for Culture Hack by Neontribe
Getting Data Ready for Culture Hack by Neontribe
 
一比一原版(LaTrobe毕业证书)拉筹伯大学毕业证如何办理
一比一原版(LaTrobe毕业证书)拉筹伯大学毕业证如何办理一比一原版(LaTrobe毕业证书)拉筹伯大学毕业证如何办理
一比一原版(LaTrobe毕业证书)拉筹伯大学毕业证如何办理
 
UXpert_Report (UALR Mapping Renewal 2022).pdf
UXpert_Report (UALR Mapping Renewal 2022).pdfUXpert_Report (UALR Mapping Renewal 2022).pdf
UXpert_Report (UALR Mapping Renewal 2022).pdf
 
一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样
一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样
一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样
 
欧洲杯买球-欧洲杯买球买球网好的网站-欧洲杯买球哪里有正规的买球网站|【​网址​🎉ac123.net🎉​】
欧洲杯买球-欧洲杯买球买球网好的网站-欧洲杯买球哪里有正规的买球网站|【​网址​🎉ac123.net🎉​】欧洲杯买球-欧洲杯买球买球网好的网站-欧洲杯买球哪里有正规的买球网站|【​网址​🎉ac123.net🎉​】
欧洲杯买球-欧洲杯买球买球网好的网站-欧洲杯买球哪里有正规的买球网站|【​网址​🎉ac123.net🎉​】
 
International Upcycling Research Network advisory board meeting 4
International Upcycling Research Network advisory board meeting 4International Upcycling Research Network advisory board meeting 4
International Upcycling Research Network advisory board meeting 4
 
Graphic Design Tools and Software .pptx
Graphic Design Tools and Software   .pptxGraphic Design Tools and Software   .pptx
Graphic Design Tools and Software .pptx
 
CocaCola_Brand_equity_package_2012__.pdf
CocaCola_Brand_equity_package_2012__.pdfCocaCola_Brand_equity_package_2012__.pdf
CocaCola_Brand_equity_package_2012__.pdf
 
哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样
哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样
哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样
 
Heuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdfHeuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdf
 
Discovering the Best Indian Architects A Spotlight on Design Forum Internatio...
Discovering the Best Indian Architects A Spotlight on Design Forum Internatio...Discovering the Best Indian Architects A Spotlight on Design Forum Internatio...
Discovering the Best Indian Architects A Spotlight on Design Forum Internatio...
 
AHMED TALAAT ARCHITECTURE PORTFOLIO .pdf
AHMED TALAAT ARCHITECTURE PORTFOLIO .pdfAHMED TALAAT ARCHITECTURE PORTFOLIO .pdf
AHMED TALAAT ARCHITECTURE PORTFOLIO .pdf
 
一比一原版(CSU毕业证书)查尔斯特大学毕业证如何办理
一比一原版(CSU毕业证书)查尔斯特大学毕业证如何办理一比一原版(CSU毕业证书)查尔斯特大学毕业证如何办理
一比一原版(CSU毕业证书)查尔斯特大学毕业证如何办理
 
一比一原版美国哥伦比亚大学毕业证Columbia成绩单一模一样
一比一原版美国哥伦比亚大学毕业证Columbia成绩单一模一样一比一原版美国哥伦比亚大学毕业证Columbia成绩单一模一样
一比一原版美国哥伦比亚大学毕业证Columbia成绩单一模一样
 

Android development workshop

  • 1. Cross-Development for Android & Other Mobile Platforms Prof. Jeff Sonstein Dept. of Information Sciences & Technologies Rochester Institute of Technology jxsast@rit.edu
  • 2. Why This Talk • Coding is easy, design is hard • Maintaining multiple development teams & codebases is costly & error-prone • Users appreciate a reasonably consistent experience across platforms
  • 3. Designing for Mobile 1. design for One Web 2. rely on standards 3. avoid known hazards 4. be cautious of device limitations 5. optimize navigation 6. check graphics and colors 7. keep it small 8. use network sparingly 9. help & guide user input 10. think of users on-the-go http://www.w3.org/2007/02/mwbp_flip_cards.html
  • 4. WebApps, Native Apps, & Cross-Compilation • WebApps: browser context, served over Web, written in HTML/CSS/JavaScript • Native Apps: written in higher-level language specific to that platform • Cross-compilers: advantages of WebApps but install as native apps
  • 5. Phonegap & Mobile Devices • PhoneGap is a tool which allows you to compose once (using HTML/CSS/JavaScript) then cross- compile and deploy to many different target platforms: • iOs • Android • Blackberry • webOS • Windows Mobile • Symbian
  • 6. Installing Phonegap • see http://www.ist.rit.edu/~jxs/classes/2010_Winter/MobileFoundations/01_week/ phonegapStart.html for more details • download and install Android SDKs • download PhoneGap • unarchive it into an arbitrary directory • make sure Android tools directory is in your $PATH (on my system: /Users/ jeffs/development/android/tools)
  • 7. Compiling & Deploying Phonegap Apps • open a terminal window and navigate to appropriate PhoneGap directory (on my system: /Users/jeffs/development/phonegap/phonegap-android/) • compile with droidgap tool (see details page on previous slide) • open second terminal window and start Android emulator or plug in Android device • change directory to wherever you told droidgap to put the generated code • issue command ant debug install
  • 8. Demo • exit to live demo
  • 9. Phonegap Docs & Materials Online • common functionality: http://docs.phonegap.com/ • tutorials: http://wiki.phonegap.com/w/page/ 16494772/FrontPage • google group: http://groups.google.com/group/ phonegap • source repository: https://github.com/phonegap • development tools: http://www.phonegap.com/tools/
  • 10. Phonegap API Capabilities • High-level common mobile functionality API • Support for HTML5 & CSS3
  • 11. Common Functionality: Accelerometer • Captures device motion in X/Y/Z directions • Methods: • getCurrentAcceleration • watchAcceleration • clearWatch
  • 12. Common Functionality: Camera • Provides access to default camera • Method: • getPicture
  • 13. Common Functionality: Compass • Obtains direction device is pointing • Methods: • getCurrentHeading • watchHeading • clearWatch
  • 14. Common Functionality: Contacts • Provides access to device contacts database • Methods: • create • find
  • 15. Common Functionality: Device • Gather device hardware/software info • Properties: • name • phonegap (gets version) • platform • uuid • version
  • 16. Common Functionality: Events • Fires when Phonegap has loaded • Event: • deviceready
  • 17. Common Functionality: File System • Provides access to the device file system • Objects: • FileReader • FileWriter • FileError
  • 18. Common Functionality: Geolocation • Provides access to the GPS sensor • Methods: • getCurrentPosition • watchPosition • clearWatch
  • 19. Common Functionality: Media • Provides ability to record and play back audio • Methods: • getCurrentPosition • getDuration • play/pause • release • start/stop record • stop
  • 20. Common Functionality: Network • Access both cellular & wifi connection info • Method: • isReachable
  • 21. Common Functionality: Notifications • Visual, audible, & tactile device notifications • Methods: • alert • confirm • beep • vibrate
  • 22. Common Functionality: Storage • Access device database implementation • Method: • openDatabase • Database object manipulation sub- methods
  • 23. HTML5 localStorage • name/value pairs (think associative array) • persists between sessions • example: • http://www.ist.rit.edu/~jxs/classes/2010_Winter/ MobileFoundations/05_week/storage.html
  • 24. CSS3 & Webkit • Support table: • http://westciv.com/wiki/ Experimental_CSS_compatibility_table • Tutorial: • http://www.cardeo.ca/css3-handbook/
  • 26. Summary • Design design design, then code once • Maintaining a single design team and one codebase and having a unified UX across platforms is generally more efficient • Leveraging your Web developer’s skills is generally A Good Idea
  • 27. Exercise • Download and install Android development tools • Download and install PhoneGap • Compile & test/deploy example app from PhoneGap directory • Write, compile, & test/deploy your own HelloWorld app
  • 28. Cross-Development for Android & Other Mobile Platforms Prof. Jeff Sonstein Dept. of Information Sciences & Technologies Rochester Institute of Technology jxsast@rit.edu