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

PPTX
Phonegap
PDF
Abilità Informatiche - Lezione 01 introduzione al corso
PDF
Behaviour testing for single-page applications and API’s
PPTX
Web application presentation
PDF
IE MiM Application Presentation Alejandro Morante
PPT
Sample Power Point
KEY
Mobile Web Apps Best Practices Presentation at Design4Mobile 2009
PPT
Application presentation
Phonegap
Abilità Informatiche - Lezione 01 introduzione al corso
Behaviour testing for single-page applications and API’s
Web application presentation
IE MiM Application Presentation Alejandro Morante
Sample Power Point
Mobile Web Apps Best Practices Presentation at Design4Mobile 2009
Application presentation

Similar to Android development workshop (20)

KEY
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
PPTX
Phone gap development, testing, and debugging
PDF
Building cross platform mobile web apps
PPTX
phonegap_101
PDF
mobicon_paper
PPTX
All About Phonegap
KEY
Future of Mobile
PPT
Mobile app development using PhoneGap - A comprehensive walkthrough - Touch T...
PDF
Building Mobile Cross-Platform Apps with HTML5, jQuery Mobile & PhoneGap
PDF
Building Cross Platform Mobile Web Apps
KEY
Philly ete-2011
PDF
PhoneGap mobile development
PDF
Maximiliano Firtman - Разработка приложений с помощью PhoneGap
PDF
Introduction to phone gap
PDF
Introduction to Phonegap
PDF
Brian Le Roux Presentation Introducing Phone Gap
PPTX
An overview of mobile html + java script frameworks
PDF
HTML5 and the dawn of rich mobile web applications
PPTX
Intro to PhoneGap
PDF
Anatomy of an HTML 5 mobile web app
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
Phone gap development, testing, and debugging
Building cross platform mobile web apps
phonegap_101
mobicon_paper
All About Phonegap
Future of Mobile
Mobile app development using PhoneGap - A comprehensive walkthrough - Touch T...
Building Mobile Cross-Platform Apps with HTML5, jQuery Mobile & PhoneGap
Building Cross Platform Mobile Web Apps
Philly ete-2011
PhoneGap mobile development
Maximiliano Firtman - Разработка приложений с помощью PhoneGap
Introduction to phone gap
Introduction to Phonegap
Brian Le Roux Presentation Introducing Phone Gap
An overview of mobile html + java script frameworks
HTML5 and the dawn of rich mobile web applications
Intro to PhoneGap
Anatomy of an HTML 5 mobile web app
Ad

Recently uploaded (20)

PPT
Machine printing techniques and plangi dyeing
PDF
Integrated-2D-and-3D-Animation-Bridging-Dimensions-for-Impactful-Storytelling...
PDF
UNIT 1 Introduction fnfbbfhfhfbdhdbdto Java.pptx.pdf
PDF
The Advantages of Working With a Design-Build Studio
PPTX
An introduction to AI in research and reference management
PDF
Design Thinking - Module 1 - Introduction To Design Thinking - Dr. Rohan Dasg...
PPTX
Special finishes, classification and types, explanation
PDF
SEVA- Fashion designing-Presentation.pdf
PDF
BRANDBOOK-Presidential Award Scheme-Kenya-2023
PPTX
mahatma gandhi bus terminal in india Case Study.pptx
PPTX
6- Architecture design complete (1).pptx
PPTX
areprosthodontics and orthodonticsa text.pptx
PPTX
Entrepreneur intro, origin, process, method
PPTX
Tenders & Contracts Works _ Services Afzal.pptx
PDF
YOW2022-BNE-MinimalViableArchitecture.pdf
PDF
Emailing DDDX-MBCaEiB.pdf DDD_Europe_2022_Intro_to_Context_Mapping_pdf-165590...
DOCX
actividad 20% informatica microsoft project
PPTX
DOC-20250430-WA0014._20250714_235747_0000.pptx
PPT
pump pump is a mechanism that is used to transfer a liquid from one place to ...
PPT
WHY_R12 Uaafafafpgradeaffafafafaffff.ppt
Machine printing techniques and plangi dyeing
Integrated-2D-and-3D-Animation-Bridging-Dimensions-for-Impactful-Storytelling...
UNIT 1 Introduction fnfbbfhfhfbdhdbdto Java.pptx.pdf
The Advantages of Working With a Design-Build Studio
An introduction to AI in research and reference management
Design Thinking - Module 1 - Introduction To Design Thinking - Dr. Rohan Dasg...
Special finishes, classification and types, explanation
SEVA- Fashion designing-Presentation.pdf
BRANDBOOK-Presidential Award Scheme-Kenya-2023
mahatma gandhi bus terminal in india Case Study.pptx
6- Architecture design complete (1).pptx
areprosthodontics and orthodonticsa text.pptx
Entrepreneur intro, origin, process, method
Tenders & Contracts Works _ Services Afzal.pptx
YOW2022-BNE-MinimalViableArchitecture.pdf
Emailing DDDX-MBCaEiB.pdf DDD_Europe_2022_Intro_to_Context_Mapping_pdf-165590...
actividad 20% informatica microsoft project
DOC-20250430-WA0014._20250714_235747_0000.pptx
pump pump is a mechanism that is used to transfer a liquid from one place to ...
WHY_R12 Uaafafafpgradeaffafafafaffff.ppt
Ad

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