Intro to Android
   For the iOS fan
        Denver Java Users Group
               January 11, 2012
                  Mike Wolfson
About Me




Droid Of The Day
Introduction

• iPhone is different than Android
  – Can’t directly port
  – Web is not the same either
• Android has it’s own peculiarities and UI
  paradigms, that must considered
• Asset management is particularly
  important
Open Handset Alliance




”Android was built from the ground up with the
  explicit goal to be the first open, complete, and
  free platform created specifically for mobile
  devices.”
http://www.openhandsetalliance.com
Revision lifecycle
• Named after deserts
  – Donut, Éclair, Froyo, Honeycomb
• “Ice Cream Sandwich” (OS 4.0)
  – Due Q4
  – OS 4.0
  – “Universal OS”
• 6 month releases
Open and Free


                                • Open Source:
                                • No licensing cost
                                  for manufacturers
                                • Can be used in
                                  different ways


http://source.android.com/download
Different “Flavors” of Android


             • AOSP
             • With Google
               Experience
             • Amazon Fork
             • CyanogenMod
Complete

•   Computer in a box
•   Android@Home
•   TV
•   One OS to run
    everywhere
Growth

• Manufacturers and carriers love it
• 700,000 Devices Activated a day
• Developers love it
   – Much less control
   – Less restrictions make for easier money making
• It’s getting big
   – 36 OEMs, 215 Carriers, 450K Devs
Lots and lots of
different devices
Devices – iOS
Devices – Android
Vendor Customizations




  Google        HTC      Samsung     Motorola
Standard UI   Sense UI   Touch Wiz   Moto Blur
Many PhonesCarriersManufacturers

• Fragmentation
• Not all phones are created equal
• Vendor UI Customization
• Carrier is in control
• Irregular upgrade lifecycle
Multiple resources and layouts

• Multiple Layouts
  and Graphic Assets
• Can also be used for
  language localization
• Use Density Independent
   values (DP) in layouts
  Ex. android:paddingLeft="8dp“
• draw9patch
Testing Multiple Devices




• Emulator
• “Dogfooding”
Developing Apps
Android Dev Tools


• Eclipse
• Java
• Common tools and add-ons are supported by
  default
• Object oriented with a strong emphasis for
  configuration over coding
• Tools are optional (not required)
Automated Testing
• Continuous Integration tools
  – MavenJenkins plugins
  http://code.google.com/p/maven-android-plugin/Performance testing

• SDK Tools
  – TraceRunner, etc
  – Monkey Runner
• External Resources
  – Robotium
Support resources

• iPhone dev’s must sign
  NDA, which means content is
  fairly light on the web
  –Must pay to join dev
   program, where all the info is.
• Plenty of free Android resources
Distributing Apps
App Store
•   Content of store
•   Approval Process
•   Feedback
•   Web component
•   Low barrier to entry ($25/life)
•   Android Market not mandatory
    – Side load
    – Alternative markets
UI Patterns &
 Paradigms
Icons

    • “I won’t download an app with
      crappy icons”
    • Google clearly defines guidelines
    • Ice Cream Sandwich changes



http://developer.android.com/guide/practices/ui_guidelines/icon_design.html
Android UI Paradigms

• 4 buttons
    –   “Back”
    –   “Menu” - context sensitive
    –   “Home”
    –   “Search” – context sensitive
•   Widgets and shortcuts
•   Customizable Home screen
•   Notifications
•   Live Wallpaper
•   “App Drawer”
Navigation




iOS   Android
Dashboard Pattern




http://www.androidpatterns.com/uap_pattern/dashboard
Action Bar Pattern




http://www.androidpatterns.com/uap_pattern/action-bar
Questions?
Part 2 prep (optional):
1. Download Project:
   http://dl.dropbox.com/u/23589031/DJUG.zip
2. Unzip project to desktop
3. In Eclipse: FileImportImport Existing
   Project into workspace

Intro to Android for the iOS Fan

  • 1.
    Intro to Android For the iOS fan Denver Java Users Group January 11, 2012 Mike Wolfson
  • 2.
  • 3.
    Introduction • iPhone isdifferent than Android – Can’t directly port – Web is not the same either • Android has it’s own peculiarities and UI paradigms, that must considered • Asset management is particularly important
  • 4.
    Open Handset Alliance ”Androidwas built from the ground up with the explicit goal to be the first open, complete, and free platform created specifically for mobile devices.” http://www.openhandsetalliance.com
  • 5.
    Revision lifecycle • Namedafter deserts – Donut, Éclair, Froyo, Honeycomb • “Ice Cream Sandwich” (OS 4.0) – Due Q4 – OS 4.0 – “Universal OS” • 6 month releases
  • 6.
    Open and Free • Open Source: • No licensing cost for manufacturers • Can be used in different ways http://source.android.com/download
  • 7.
    Different “Flavors” ofAndroid • AOSP • With Google Experience • Amazon Fork • CyanogenMod
  • 8.
    Complete • Computer in a box • Android@Home • TV • One OS to run everywhere
  • 9.
    Growth • Manufacturers andcarriers love it • 700,000 Devices Activated a day • Developers love it – Much less control – Less restrictions make for easier money making • It’s getting big – 36 OEMs, 215 Carriers, 450K Devs
  • 10.
    Lots and lotsof different devices
  • 11.
  • 12.
  • 13.
    Vendor Customizations Google HTC Samsung Motorola Standard UI Sense UI Touch Wiz Moto Blur
  • 14.
    Many PhonesCarriersManufacturers • Fragmentation •Not all phones are created equal • Vendor UI Customization • Carrier is in control • Irregular upgrade lifecycle
  • 15.
    Multiple resources andlayouts • Multiple Layouts and Graphic Assets • Can also be used for language localization • Use Density Independent values (DP) in layouts Ex. android:paddingLeft="8dp“ • draw9patch
  • 16.
    Testing Multiple Devices •Emulator • “Dogfooding”
  • 17.
  • 18.
    Android Dev Tools •Eclipse • Java • Common tools and add-ons are supported by default • Object oriented with a strong emphasis for configuration over coding • Tools are optional (not required)
  • 19.
    Automated Testing • ContinuousIntegration tools – MavenJenkins plugins http://code.google.com/p/maven-android-plugin/Performance testing • SDK Tools – TraceRunner, etc – Monkey Runner • External Resources – Robotium
  • 20.
    Support resources • iPhonedev’s must sign NDA, which means content is fairly light on the web –Must pay to join dev program, where all the info is. • Plenty of free Android resources
  • 21.
  • 22.
    App Store • Content of store • Approval Process • Feedback • Web component • Low barrier to entry ($25/life) • Android Market not mandatory – Side load – Alternative markets
  • 23.
    UI Patterns & Paradigms
  • 24.
    Icons • “I won’t download an app with crappy icons” • Google clearly defines guidelines • Ice Cream Sandwich changes http://developer.android.com/guide/practices/ui_guidelines/icon_design.html
  • 25.
    Android UI Paradigms •4 buttons – “Back” – “Menu” - context sensitive – “Home” – “Search” – context sensitive • Widgets and shortcuts • Customizable Home screen • Notifications • Live Wallpaper • “App Drawer”
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
    Part 2 prep(optional): 1. Download Project: http://dl.dropbox.com/u/23589031/DJUG.zip 2. Unzip project to desktop 3. In Eclipse: FileImportImport Existing Project into workspace

Editor's Notes

  • #2 The big difference is that the iPhone is a single device, while Android is a software platform. That makes a straight comparison difficult but not impossible; it's like comparing Macs to PCs, as many bloggers have noted. Apple carefully controls everything available on its iPhone. Google's Android, on the other hand, offers its adherents something else: freedom to do whatever you'd like with your phone.
  • #3 Fragmentation – just announced deal at IO that OS updates will be guaranteed for first 18 months since buying your phone.
  • #4 Fragmentation – just announced deal at IO that OS updates will be guaranteed for first 18 months since buying your phone.
  • #5 More CompaniesCom
  • #6 Fragmentation – just announced deal at IO that OS updates will be guaranteed for first 18 months since buying your phone.But more importantly, App, Game and software developers will only have to create one version for Ice Cream Sandwich, and there product will perform exactly as intended, regardless of device shape, size, monitor type, or main function.
  • #7 Open Source:http://source.android.com/downloadNo licensing cost for manufacturersMeans lots of devices, of all varietiesPhone manufacturers save $20Apple and BB, and MS historically charged $20 per phone. Not sure now they own Nokia.Open source allows interesting things (Guardian Phone), ROM Cooking, Rooting culturePossibility to do much more on Android – completely customizableRoot phonesAccess to much wider variety of hw through Android right out of the box (pretty much everything)UI can be modified to Possibility for bad things is higherPermissions framework for managing thisTrue Multi-tasking, including allowing background processingOpen source On many different devicesModding communityGoogle really controls the OSFlash allowedPhoneGap, Titanium, supportedEasier for companies to support their products, since they don’t require the approval of AppleManufacturers and Carriers have a lot of power to control the hw (and experience)Ex. AT&T limits the app store
  • #8 Open Source:http://source.android.com/downloadNo licensing cost for manufacturersMeans lots of devices, of all varietiesPhone manufacturers save $20Apple and BB, and MS historically charged $20 per phone. Not sure now they own Nokia.Open source allows interesting things (Guardian Phone), ROM Cooking, Rooting culturePossibility to do much more on Android – completely customizableRoot phonesAccess to much wider variety of hw through Android right out of the box (pretty much everything)UI can be modified to Possibility for bad things is higherPermissions framework for managing thisTrue Multi-tasking, including allowing background processingOpen source On many different devicesModding communityGoogle really controls the OSFlash allowedPhoneGap, Titanium, supportedEasier for companies to support their products, since they don’t require the approval of AppleManufacturers and Carriers have a lot of power to control the hw (and experience)Ex. AT&T limits the app store
  • #9 Open Source:http://source.android.com/downloadNo licensing cost for manufacturersMeans lots of devices, of all varietiesPhone manufacturers save $20Apple and BB, and MS historically charged $20 per phone. Not sure now they own Nokia.Open source allows interesting things (Guardian Phone), ROM Cooking, Rooting cultureOne OS to run everywhere -In particular the next version of the OS (3.1 – Ice Cream Sandwich) brings all the different versions back into a single codebase
  • #10 Fragmentation – just announced deal at IO that OS updates will be guaranteed for first 18 months since buying your phone.
  • #11 The big difference is that the iPhone is a single device, while Android is a software platform. That makes a straight comparison difficult but not impossible; it's like comparing Macs to PCs, as many bloggers have noted. Apple carefully controls everything available on its iPhone. Google's Android, on the other hand, offers its adherents something else: freedom to do whatever you'd like with your phone.
  • #13 How many different devices are there?Devices have different capabilitiesSome have GPS, some don’t have market
  • #15 FragmentationFragmentation based on device size; capability; OS Version, etc– just announced deal at IO that OS updates will be guaranteed for first 18 months since buying your phone.Not all phones are created equal (display resolution\\size; processor speed; internet connectivity)Custom UI enhancementsSense UI; MotoBlur, TouchWiz, etcCarrier is in controlOne OS to run everywhere
  • #17 EmulatorTesting with various screen sizesUsing skins to emulate specific vendor UisUse real devices“Dogfooding”Can side-load very easily (another key difference from iPhone, as it is not easy (adhoc group creation, an other limits from licensing)
  • #18 The big difference is that the iPhone is a single device, while Android is a software platform. That makes a straight comparison difficult but not impossible; it's like comparing Macs to PCs, as many bloggers have noted. Apple carefully controls everything available on its iPhone. Google's Android, on the other hand, offers its adherents something else: freedom to do whatever you'd like with your phone.
  • #19 EclipseFree to download and use SDKSame tool many people already use (JDT tools)Standard stuff that makes Eclipse easy to use are there: incremental compile, syntax highlighting, integrated debugger, content assist, quick-fixes, organize imports, refactoring, etcJava Some but not all of the standard Java libraries are available Naming conventions, coding style, and syntax are identicalCommon tools and add-ons are supported by defaultMVN, JUnit, Emma, Mylin, etcObject oriented with a strong emphasis for configuration over codingXML used for layouts, etc
  • #22 The big difference is that the iPhone is a single device, while Android is a software platform. That makes a straight comparison difficult but not impossible; it's like comparing Macs to PCs, as many bloggers have noted. Apple carefully controls everything available on its iPhone. Google's Android, on the other hand, offers its adherents something else: freedom to do whatever you'd like with your phone.
  • #23 Same number of apps in both stores, but quality probably worse in Android more free apps than paidNo approval process to Android MarketCan upload upgrades instantlyMore free apps than paid in AMLow barrier to entry ($25 for life)AM is not perfectFeedback forum is one wayAM is not required to get apps on a phoneCan be side loaded directlyAlternative markets exist (notable Amazon, and B&N Nook)Approval requiredLittle information provided if you app is rejectedNo money paid out until you reach $250Google pays out at $1
  • #24 The big difference is that the iPhone is a single device, while Android is a software platform. That makes a straight comparison difficult but not impossible; it's like comparing Macs to PCs, as many bloggers have noted. Apple carefully controls everything available on its iPhone. Google's Android, on the other hand, offers its adherents something else: freedom to do whatever you'd like with your phone.Iphone differences: One button that always brings you homeHome is launcher, with icons containing appsScreen to left of home is “spotlight” screen, with search, etcAndroid 4 buttons Home screens are completely customizable
  • #27 Notice there is no “Back” button, or nav bar. These are taken care of using the “Back” and “Menu” buttonsAll the functionality that on the iPhone would rest in the nav bar, toolbar, or action sheet – should live in the Options menu It is not a good idea to create the Android design to mimick the iPhone (using on screen navigation component).
  • #28 The action bar:is located at the top of the screen to support navigation and highlight important functionalitiesreplaces the title bar (which is often included into it)is best used for actions across your app, like search, refresh and composecan provide a quick link to app home by tapping the app logois preferably not contextual, but actions can differ from page to pageYou want to bring key actions on screen, so they are in sight. You don't want to hide them under the menu-button. The action bar is best used for common actions like search, refresh and compose. When screen real estate is valuable, consider putting actions in the options menu.Honeycomb actually migrates “Menu” items directly into action bar.
  • #29 The action bar:is located at the top of the screen to support navigation and highlight important functionalitiesreplaces the title bar (which is often included into it)is best used for actions across your app, like search, refresh and composecan provide a quick link to app home by tapping the app logois preferably not contextual, but actions can differ from page to pageYou want to bring key actions on screen, so they are in sight. You don't want to hide them under the menu-button. The action bar is best used for common actions like search, refresh and compose. When screen real estate is valuable, consider putting actions in the options menu.Honeycomb actually migrates “Menu” items directly into action bar.
  • #30 The big difference is that the iPhone is a single device, while Android is a software platform. That makes a straight comparison difficult but not impossible; it's like comparing Macs to PCs, as many bloggers have noted. Apple carefully controls everything available on its iPhone. Google's Android, on the other hand, offers its adherents something else: freedom to do whatever you'd like with your phone.
  • #31 The big difference is that the iPhone is a single device, while Android is a software platform. That makes a straight comparison difficult but not impossible; it's like comparing Macs to PCs, as many bloggers have noted. Apple carefully controls everything available on its iPhone. Google's Android, on the other hand, offers its adherents something else: freedom to do whatever you'd like with your phone.