SlideShare a Scribd company logo
1 of 28
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

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
 
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
 
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

如何办理(UAL毕业证书)伦敦艺术大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(UAL毕业证书)伦敦艺术大学毕业证成绩单本科硕士学位证留信学历认证如何办理(UAL毕业证书)伦敦艺术大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(UAL毕业证书)伦敦艺术大学毕业证成绩单本科硕士学位证留信学历认证
ugzga
 
挂科办理天主教大学毕业证成绩单一模一样品质
挂科办理天主教大学毕业证成绩单一模一样品质挂科办理天主教大学毕业证成绩单一模一样品质
挂科办理天主教大学毕业证成绩单一模一样品质
yzeoq
 
100^%)( KATLEHONG))(*((+27838792658))*))௹ )Abortion Pills for Sale in Doha, D...
100^%)( KATLEHONG))(*((+27838792658))*))௹ )Abortion Pills for Sale in Doha, D...100^%)( KATLEHONG))(*((+27838792658))*))௹ )Abortion Pills for Sale in Doha, D...
100^%)( KATLEHONG))(*((+27838792658))*))௹ )Abortion Pills for Sale in Doha, D...
pillahdonald
 
如何办理(Columbia College毕业证书)纽约市哥伦比亚大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(Columbia College毕业证书)纽约市哥伦比亚大学毕业证成绩单本科硕士学位证留信学历认证如何办理(Columbia College毕业证书)纽约市哥伦比亚大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(Columbia College毕业证书)纽约市哥伦比亚大学毕业证成绩单本科硕士学位证留信学历认证
ugzga
 
Week 11 Mini-Tasks.pptxjjjjjjjjjjjjjjjjjjjj
Week 11 Mini-Tasks.pptxjjjjjjjjjjjjjjjjjjjjWeek 11 Mini-Tasks.pptxjjjjjjjjjjjjjjjjjjjj
Week 11 Mini-Tasks.pptxjjjjjjjjjjjjjjjjjjjj
joshuaclack73
 
100^%)( MAYIBUYE))(*((+27838792658))*))௹ )Abortion Pills for Sale in Soweto, ...
100^%)( MAYIBUYE))(*((+27838792658))*))௹ )Abortion Pills for Sale in Soweto, ...100^%)( MAYIBUYE))(*((+27838792658))*))௹ )Abortion Pills for Sale in Soweto, ...
100^%)( MAYIBUYE))(*((+27838792658))*))௹ )Abortion Pills for Sale in Soweto, ...
drjose256
 

Recently uploaded (20)

如何办理(UAL毕业证书)伦敦艺术大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(UAL毕业证书)伦敦艺术大学毕业证成绩单本科硕士学位证留信学历认证如何办理(UAL毕业证书)伦敦艺术大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(UAL毕业证书)伦敦艺术大学毕业证成绩单本科硕士学位证留信学历认证
 
挂科办理天主教大学毕业证成绩单一模一样品质
挂科办理天主教大学毕业证成绩单一模一样品质挂科办理天主教大学毕业证成绩单一模一样品质
挂科办理天主教大学毕业证成绩单一模一样品质
 
Avoid these common UI/UX design mistakes
 Avoid these common UI/UX design mistakes Avoid these common UI/UX design mistakes
Avoid these common UI/UX design mistakes
 
100^%)( KATLEHONG))(*((+27838792658))*))௹ )Abortion Pills for Sale in Doha, D...
100^%)( KATLEHONG))(*((+27838792658))*))௹ )Abortion Pills for Sale in Doha, D...100^%)( KATLEHONG))(*((+27838792658))*))௹ )Abortion Pills for Sale in Doha, D...
100^%)( KATLEHONG))(*((+27838792658))*))௹ )Abortion Pills for Sale in Doha, D...
 
Webhost NVME Cloud VPS Hosting1234455678
Webhost NVME Cloud VPS Hosting1234455678Webhost NVME Cloud VPS Hosting1234455678
Webhost NVME Cloud VPS Hosting1234455678
 
Heidi Livengood's Professional CADD Portfolio
Heidi Livengood's Professional CADD PortfolioHeidi Livengood's Professional CADD Portfolio
Heidi Livengood's Professional CADD Portfolio
 
如何办理(Columbia College毕业证书)纽约市哥伦比亚大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(Columbia College毕业证书)纽约市哥伦比亚大学毕业证成绩单本科硕士学位证留信学历认证如何办理(Columbia College毕业证书)纽约市哥伦比亚大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(Columbia College毕业证书)纽约市哥伦比亚大学毕业证成绩单本科硕士学位证留信学历认证
 
Bit Dhrumi shah Graphic Designer portfolio
Bit Dhrumi shah Graphic Designer portfolioBit Dhrumi shah Graphic Designer portfolio
Bit Dhrumi shah Graphic Designer portfolio
 
Onyx Tiles Where Elegance Meets Durability
Onyx Tiles Where Elegance Meets DurabilityOnyx Tiles Where Elegance Meets Durability
Onyx Tiles Where Elegance Meets Durability
 
CADD 141 - BIRD Scooter - Cup Holder Photos.pdf
CADD 141 - BIRD Scooter - Cup Holder Photos.pdfCADD 141 - BIRD Scooter - Cup Holder Photos.pdf
CADD 141 - BIRD Scooter - Cup Holder Photos.pdf
 
Week 11 Mini-Tasks.pptxjjjjjjjjjjjjjjjjjjjj
Week 11 Mini-Tasks.pptxjjjjjjjjjjjjjjjjjjjjWeek 11 Mini-Tasks.pptxjjjjjjjjjjjjjjjjjjjj
Week 11 Mini-Tasks.pptxjjjjjjjjjjjjjjjjjjjj
 
NO1 Popular kala jadu karne wale ka contact number kala jadu karne wale baba ...
NO1 Popular kala jadu karne wale ka contact number kala jadu karne wale baba ...NO1 Popular kala jadu karne wale ka contact number kala jadu karne wale baba ...
NO1 Popular kala jadu karne wale ka contact number kala jadu karne wale baba ...
 
Mark Zuckerberg Carthago Delenda Est Shirt
Mark Zuckerberg Carthago Delenda Est ShirtMark Zuckerberg Carthago Delenda Est Shirt
Mark Zuckerberg Carthago Delenda Est Shirt
 
100^%)( MAYIBUYE))(*((+27838792658))*))௹ )Abortion Pills for Sale in Soweto, ...
100^%)( MAYIBUYE))(*((+27838792658))*))௹ )Abortion Pills for Sale in Soweto, ...100^%)( MAYIBUYE))(*((+27838792658))*))௹ )Abortion Pills for Sale in Soweto, ...
100^%)( MAYIBUYE))(*((+27838792658))*))௹ )Abortion Pills for Sale in Soweto, ...
 
The Impact of Artificial Intelligence on Modern Healthcare.pptx
The Impact of Artificial Intelligence on Modern Healthcare.pptxThe Impact of Artificial Intelligence on Modern Healthcare.pptx
The Impact of Artificial Intelligence on Modern Healthcare.pptx
 
Top 10 Website Designing Hacks for Beginners.pptx.pptx
Top 10 Website Designing Hacks for Beginners.pptx.pptxTop 10 Website Designing Hacks for Beginners.pptx.pptx
Top 10 Website Designing Hacks for Beginners.pptx.pptx
 
FW25-26 Fashion Key Items Trend Book Peclers Paris
FW25-26 Fashion Key Items Trend Book Peclers ParisFW25-26 Fashion Key Items Trend Book Peclers Paris
FW25-26 Fashion Key Items Trend Book Peclers Paris
 
Abdulaziz Tariq Abdulaziz Mustafa CV 2024
Abdulaziz Tariq Abdulaziz Mustafa CV 2024Abdulaziz Tariq Abdulaziz Mustafa CV 2024
Abdulaziz Tariq Abdulaziz Mustafa CV 2024
 
Explaining the Hidden Treasures of Modern Bathroom Design — freixadesign.pdf
Explaining the Hidden Treasures of Modern Bathroom Design — freixadesign.pdfExplaining the Hidden Treasures of Modern Bathroom Design — freixadesign.pdf
Explaining the Hidden Treasures of Modern Bathroom Design — freixadesign.pdf
 
BIT Khushi gandhi project.pdf graphic design
BIT Khushi gandhi project.pdf graphic designBIT Khushi gandhi project.pdf graphic design
BIT Khushi gandhi project.pdf graphic design
 

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