SlideShare a Scribd company logo
Climbing Mount Android

     Rajesh Vasa, 2011
        Twitter: @rvasa
    http://www.rvasa.com



             1
Mobile Eco-System


                      Content Providers
                     (Music/Video/Books)


 Ad Networks                                       App.
                                               Distribution

                        Platform
                                                Billing




         Telephone          Handset            Cloud
         Networks            OEMs          Infrastructure


                            2                   R. Vasa, 2011
Android Eco-System

                           Content Providers
                          (Music/Video/Books)          Google, Amazon

                                                           App.
 Ad Networks                         **                Distribution

   Google, Double Click
                             Platform           Google Checkout
                               Android                   Billing

                                                   Google, Amazon

        Telephone                Handset                Cloud
        Networks                 (OEMs)             Infrastructure

                    Samsung, HTC, Motorola, Sony ...

                                 3                        R. Vasa, 2011
Focus of this talk...

                          Content Providers
                         (Music/Video/Books)          Google, Amazon

                                                          App.
Ad Networks                           **              Distribution

  Google, Double Click    Android              Google Checkout

                          Platform                      Billing

                                                  Google, Amazon

      Telephone                 Handset        Cloud
  ThisNetworks
       talk will    present    a(OEMs)
                                 development perspective
                                           Infrastructure

                   Samsung, HTC, Motorola, Sony ...


                                  4                       R. Vasa, 2011
Talk Overview
 • Devices

 • What is Android?

 • Development Tools

 • The Android Way
 • Anatomy of a Simple Android Application

 • An Interactive Android Application

 • Dealing with Multiple Activities

 • Activity Life Cycle (the odd thing)
                      5              R. Vasa, 2011
Roadmap - Where are we?
 • Devices

 • What is Android?

 • The Android Way

 • Anatomy of a Simple Android Application
 • An Interactive Android Application

 • Dealing with Multiple Activities

 • Activity Life Cycle (the odd thing)



                      6              R. Vasa, 2011
Android Device User Interaction




                       Android devices have
                       three key buttons
Menu


Back                    Home


                   7               R. Vasa, 2011
Vendors can add additional buttons




                   8            R. Vasa, 2011
There are variations in physical form




  But all phones have Home, Menu, & Back Buttons
                        9               R. Vasa, 2011
Home Button...
 •  Typically, this will take you back to the Home
    Screen of the phone

 • Default behaviour ~ iPhone / iPad button




                               Home
                        10              R. Vasa, 2011
Back Button
 •  This will take you back to the previous screen

 • If app. has only one screen, this will exit app.




                               Personal Opinion:
 Back                          iPhone / iPad should
                               borrow this button




                        11                R. Vasa, 2011
Menu Button
 •  Shows a contextual menu (if one is available)

 • Developers can write their own menus

 • Quite handy (but, causes Usability issues)

   •   Low Discoverability




Menu (as open)



                         12             R. Vasa, 2011
Android for tablets is slightly different...

                                                   Action Bar




                                     Where is the menu button?




Back, Home
(Buttons need not be physical in Android)
                             13                  R. Vasa, 2011
Tablet Menu Icon Visibility is contextual
                      Menu




    Sadly, menu position is not mandated (yuk?)
                         14               R. Vasa, 2011
Roadmap - Where are we?
 • Devices

 • What is Android?

 • Development Tools

 • The Android Way
 • Anatomy of a Simple Android Application

 • An Interactive Android Application

 • Dealing with Multiple Activities

 • Activity Life Cycle (the odd thing)
                      15             R. Vasa, 2011
What is Android?
 •   Android is a platform

  • Operating System (with primitive API)
  • Frameworks (incl. components and libraries)

                             Applications

                               Frameworks
          Android
                          API
                   Operating System
               (Customised Linux Kernel)

                        16                  R. Vasa, 2011
Android
  Programming languages: Java, C/C++




          Image Source: http://developer.android.com
                              17                       R. Vasa, 2011
Android is a bi-lingual platform
       C/C++                                 Java




             Image Source: http://www.tbray.org
                             18                     R. Vasa, 2011
Most Android Code is in Java (but...)




                 ≠
   Android Java is not 100% Sun Java
                    19            R. Vasa, 2011
Android Java is different (in many ways)



No RMI
No Bytecode

No AWT / Swing UI

Different 2D/3D libs

Different Class Load Mechanism


                       20        R. Vasa, 2011
Roadmap - Where are we?
 • Devices

 • What is Android?

 • Development Tools

 • The Android Way
 • Anatomy of a Simple Android Application

 • An Interactive Android Application

 • Dealing with Multiple Activities

 • Activity Life Cycle (the odd thing)
                      21             R. Vasa, 2011
Development Tools
 •   Android SDK (Compiler and Emulator)

 • Eclipse IDE + Android Plug-in

  • Powerful debugger
  • Visual UI Builder
 •   Ant (Build System)



  Download from http://developer.android.com


                          22          R. Vasa, 2011
Eclipse IDE




              23   R. Vasa, 2011
Eclipse IDE - Graphical UI Editor




                     24             R. Vasa, 2011
Android Emulator




                        Permits checking Portrait
                          and Landscape views

                   25                  R. Vasa, 2011
Emulator is nice .. but phone is better
 •  The emulator runs the Android O/S (you can
    run any version: 1.6 to 3.0)

 • Emulates the phone hardware (like VM Ware)

 • Emulator does not have sensors (e.g. GPS,
   Gyro, Accelerometer, Cell phone etc.)

  • It however offers ways to simulate these
    events

  • make a phone call to it
    So, I can send an SMS to the emulator or




                       26              R. Vasa, 2011
Emulators Vs Simulator
 •   iOS offers a simulator

 • Android has gone down the emulator path

 • Trade-offs (pros and cons),

  •   Simulators start-up faster, good enough

  • Emulators allow closer to phone hardwareof
    the O/S easily +
                     checking against rel. 1.6


 •   Emulators and Simulators cannot mimic real
     CPU speed, disk speed, network speed etc.
     (yet!)


                         27              R. Vasa, 2011
If your Java is rusty




       Free e-Book: http://www.mindview.net/Books/TIJ/

                             28                     R. Vasa, 2011
Roadmap - Where are we?
 • Devices

 • What is Android?

 • Development Tools

 •The Android Way
 • Anatomy of a Simple Android Application

 • An Interactive Android Application

 • Dealing with Multiple Activities

 • Activity Life Cycle (the odd thing)
                      29             R. Vasa, 2011
The Android Way


  Convention


 Configuration

Development is organised around a few conventions
                       30               R. Vasa, 2011
Android Project Structure (convention)
              •Source code (src)
              •Generated code (gen)
              •Resources (res)
                •Images (drawable)
                •Layout of app (layout)
                •Constants/Strings (values)


                    31               R. Vasa, 2011
Needs Resources @Multiple Resolutions
                        Convention


                                      High



                                      Low



                                  Medium

                  32          R. Vasa, 2011
Roadmap - Where are we?
 •  Devices

 • What is Android?

 • Development Tools

 • The Android Way
 • Anatomy of a Simple Android Application

 • An Interactive Android Application

 • Dealing with Multiple Screens (Activities)

 • Activity Life Cycle (interesting design choice)
                        33               R. Vasa, 2011
A Simple Android App.




                   34   R. Vasa, 2011
What is involved?
 •  Place UI controls (Text and Image)

 • Layout the controls

  • Centre text
  • Make text large font
  • Display Image to take up all space




                         35              R. Vasa, 2011
Each Screen is an Activity
 •   Android app. is made up of Activities




Activity




                         36             R. Vasa, 2011
Views are Android’s Key UI Building Block
  •   We need two views on the Activity



TextView



ImageView




                         37               R. Vasa, 2011
Views are Placed inside a View Group
  •   Different types of pre-defined layouts

   • Linear, Relative, Table, Frame etc..
View Group




  a.k.a Layout

                          38                R. Vasa, 2011
Android App. - Building Blocks


  Activity       Layout          Views
                (View Group)




                     39           R. Vasa, 2011
Separation of Concerns in Android

     Presentation            Functionality




   Layout Definition          Activity Class
      (main.xml)
                           Event Handling, I/O ...

                      40               R. Vasa, 2011
UI (Layout) Definition
 •   Layout definition is generally in an XML file

  • Hand coded or Visual Editor
 •   Can be also be done in Java Code (yuk!)
   Layout Definition XML File




                               41         R. Vasa, 2011
Android Offers a number of UI Controls
 •   Offers all standard controls and lot more...




                   Progress
                                             These are
                                               a small
                                             subset of
                                              available
                                              controls
                         42               R. Vasa, 2011
View Groups and Layouts
 •   Android offers the following View Groups,

  • Linear Layout (Horizontal or Vertical)
  • Absolute Layout (You set X, Y for each View)

  • Table Layout (Rows and Columns)

  • Relative Layout (                             )
                     Position relative to other Views

  • Frame Layout (Show only one view at a time)
  • Scroll View (Permits scrolling of the screen)

 •View Groups can be nested
                        43                R. Vasa, 2011
Generated Code, Layout & Resources
 •  How did Australia image get into the App.?

 • How did we set the text to “Australia”?



 • Conventions
  • Layout Defined in /layout/main.xml
  • Resources Placed in /res/drawable-*
  • String values defined in/values/strings.xml




                       44              R. Vasa, 2011
Resources




                  Resources in “res”




            Convention
             45              R. Vasa, 2011
Resources are given a unique ID




                        A unique reference id
                          to resources is
                         generated by the
                        Android SDK tools


                 Convention
                   46               R. Vasa, 2011
Resources and Generated IDs


                        Generated Code




                static final int australia=0x7f020000;


                   47                   R. Vasa, 2011
A Reference to Layout also Generated

                  All References are Integers




                   48               R. Vasa, 2011
Identifiers are used to access resources
        This is the Activity Class




          Reference to the layout
     (Android Runtime will Render this Layout)
                       49               R. Vasa, 2011
Layout is Referred to from Java Code
 Activity       Activity Class (Java)




View Group
  (Layout)




                Layout Definition
                   (main.xml)


                       50               R. Vasa, 2011
Who writes the Activity code?




    This block of code is created by IDE/SDK
      when we create new Android project
            You can also write you own

                        51               R. Vasa, 2011
Activity Creation




     Method called (by Application Launcher)
          when App is first launched

                        52              R. Vasa, 2011
Activity Creation - Layout Rendering




  Method call will pass the reference to the layout
     that needs to be rendered on the screen
  (“Rendering” is a two-pass process: measure and draw)
                           53                  R. Vasa, 2011
What is the “root” Activity?
 •   How does Android know which Activity to
     create first?

        Answer: Application Manifest File




                        54              R. Vasa, 2011
Application Manifest File
                         Application Icon Reference




   Activity Name                  Category
                    55                  R. Vasa, 2011
Application Manifest File




    Category indicates that it can be launched
                        56               R. Vasa, 2011
Application Manifest File




Main action indicates that it is the starting point
                            57                 R. Vasa, 2011
Layouts and String Information
 •   How did we set the text to “Australia”



                                    String constant




                         58              R. Vasa, 2011
Using Graphical Resources
 •   How did the Australia image get into layout?




                      Layout can refer to resources
          @drawable is a special tag
                        59               R. Vasa, 2011
What is it with the @ tag?
 •  Constant Resources in Android can be
    referred using the “@” tag in XML layout

 • Example: @drawable, @string ...


                             @drawable/australia


                              @drawable/bots



                        60               R. Vasa, 2011
@ Tag and Multiple Screen Resolutions
  •   Dealing with multiple screen resolutions




                                 @drawable/icon




Android Runtime decides best resource to use based on
                hardware capabilities
                                          R. Vasa, 2011
Significance of hdpi/ldpi/mdpi

                    Different resolution images


                  High-Res, 240 dpi screen

                  Low-Res, 120 dpi screen

                 Med-Res, 160 dpi screen



                    62               R. Vasa, 2011
Roadmap - Where are we?
 •  Devices

 • What is Android?

 • Development Tools

 • The Android Way
 • Anatomy of a Simple Android Application

 • An Interactive Android Application

 • Dealing with Multiple Screens (Activities)

 • Life Cycle & interesting design choices
                        63             R. Vasa, 2011
Building an App with Simple Interaction
 •   Temperature Conversion (C -> F)




                        64             R. Vasa, 2011
Views

TextView

 EditText
  Button


 TextView



    4 Views (UI components) using a Linear Layout
                          65                R. Vasa, 2011
Linear Layout (View Group)




                             main.xml
                             (Layout)

                   66           R. Vasa, 2011
View Identifiers
 •   We need a way to identify components that
     we created in the layout

  • E.g. To read input data from the field
          @+id TAG creates new identifiers




                        67              R. Vasa, 2011
UI Interaction Handling Pattern
 •   Component.setOn......Listener ( handler )

  • E.g. button.setOnClickListener
 •   Handler is an anonymous inner class

  • On...Listener handler = new On....Listener() {}



                        68              R. Vasa, 2011
UI Interaction Handling Pattern
The View identifiers
are defined in XML




                      69          R. Vasa, 2011
Roadmap - Where are we?
 •  Devices

 • What is Android?

 • Development Tools

 • The Android Way
 • Anatomy of a Simple Android Application

 • An Interactive Android Application

 • Dealing with Multiple Screens (Activities)

 • Life Cycle & interesting design choices
                      70             R. Vasa, 2011
Wiring up Multiple Activities
  Contact List Activity            Contact Details



                          Select




                            Back

                             71              R. Vasa, 2011
Activities are Stacked in Android
 • All current activities are placed on a Stack
 • Newly started activities come into foreground


               Foreground/Active


                      Contact Details
 Back button will
                                         Background/
  pop top most                  starts
                                           Paused
activity from stack    Contact List


                           72            R. Vasa, 2011
Activities are like mini-processes
 •  Android activities have their own life cycle

 • Asynchronous Messaging
   Communication between Activities is done by


                     message
      Contact List              Contact Details




                        73               R. Vasa, 2011
Async. messaging called “Intents”
                      intent
     Contact List               Contact Details




 Activities communicate with each other via Intents

                         74               R. Vasa, 2011
Async. messaging called “Intents”

        Activity-X                  Photo Viewer
                      view photo
                         intent


  You can send a general purpose message (intent), all
applications capable of handling that Intent will respond



   Framework prescribes conventions for common intents
                           75                 R. Vasa, 2011
Roadmap - Where are we?
 •  Devices

 • What is Android?

 • Development Tools

 • The Android Way
 • Anatomy of a Simple Android Application

 • An Interactive Android Application

 • Dealing with Multiple Screens (Activities)

 •Life Cycle (& interesting design choices)
                       76             R. Vasa, 2011
Android Activities are Managed by O/S

                               Application
                                               Activities have a
                                              parent application

                                           Activity-A

                                       Activity-B

                                 Activity-C
                                 Activity has Life Cycle
                                Application is NOT managed
                                     directly by the O/S
      Life Cycle is Managed by Android Framework
                          77                   R. Vasa, 2011
Android Activity Life Cycle


 Activity is re-started when
   orientation changes




Developers have to save
 and retrieve state if
 orientation changes

                               78   R. Vasa, 2011
Security -- Android Devices

                   has
       User                    UID (User ID)
                  also has             determines

     Android                  File System Access
    Application                   Permissions


   The UID is generated at install time based on
         the signature and package name

                         79                R. Vasa, 2011
A Short Plug!!!




       80         R. Vasa, 2011
Mobile Development @ Swinburne
 •   HIT8328 - Software Development for
     Mobile Devices
   • Android focused
 •   HIT8329 - Creating Data Driven Mobile
     Applications
                                        We Offer
  • iOS focused                     Options to Study
 • Portfolio Based Assessments      Just One Subject
 • We do not just cover API -- thereyoua to learn)
   conceptual foundation (prepare
                                     is strong



  Teaching material will be available openly shortly
                            81                 R. Vasa, 2011
Mobile Development @ Swinburne
 • HIT8328 - Software Development for
   Mobile Devices

 •Applications
   HIT8329 - Creating Data Driven Mobile




        Teaching material will be available
         under an open license shortly

Follow @rvasa or @swinfict for update

                        82                    R. Vasa, 2011

More Related Content

What's hot

Android os(comparison all other mobile os)
Android os(comparison all other mobile os)Android os(comparison all other mobile os)
Android os(comparison all other mobile os)
DivyaKS12
 
PCTY 2012, How IBM does BYOD v. Martin Vittrup
PCTY 2012, How IBM does BYOD v. Martin VittrupPCTY 2012, How IBM does BYOD v. Martin Vittrup
PCTY 2012, How IBM does BYOD v. Martin Vittrup
IBM Danmark
 
How did we end up here? Moving beyond the website, iMA 2013
How did we end up here? Moving beyond the website, iMA 2013How did we end up here? Moving beyond the website, iMA 2013
How did we end up here? Moving beyond the website, iMA 2013
Javaun Moradi
 
The Hot Tablet Landscape by Platform, Summer 2011 Version
The Hot Tablet Landscape by Platform, Summer 2011 VersionThe Hot Tablet Landscape by Platform, Summer 2011 Version
The Hot Tablet Landscape by Platform, Summer 2011 Version
battery-fast. com
 
Layar Augmented Reality Platform - information for brands and publishers
Layar Augmented Reality Platform - information for brands and publishersLayar Augmented Reality Platform - information for brands and publishers
Layar Augmented Reality Platform - information for brands and publishers
Layar
 
Samsung's smartphone operating system: bada
Samsung's smartphone operating system: badaSamsung's smartphone operating system: bada
Samsung's smartphone operating system: bada
Samsung Economic Research Institute
 
Android and android phones
Android and android phonesAndroid and android phones
Android and android phonesTasicoPaolo
 
MonoTouch 5.2 Introduction
MonoTouch 5.2 IntroductionMonoTouch 5.2 Introduction
MonoTouch 5.2 IntroductionXamarin
 
ComparingTwo major mobile operating system
ComparingTwo major mobile operating systemComparingTwo major mobile operating system
ComparingTwo major mobile operating system
phexcom1
 
Designing the New Android Experience - The Golden Age of Android
Designing the New Android Experience - The Golden Age of AndroidDesigning the New Android Experience - The Golden Age of Android
Designing the New Android Experience - The Golden Age of Android
Mutual Mobile
 
Android Hardware That's A Little Bit... Odd
Android Hardware That's A Little Bit... OddAndroid Hardware That's A Little Bit... Odd
Android Hardware That's A Little Bit... Odd
CommonsWare
 
Intro to Android Development by Philip Peng
Intro to Android Development by Philip PengIntro to Android Development by Philip Peng
Intro to Android Development by Philip Peng
pennappsmobile
 

What's hot (14)

Android os(comparison all other mobile os)
Android os(comparison all other mobile os)Android os(comparison all other mobile os)
Android os(comparison all other mobile os)
 
Profound logic 2012
Profound logic 2012Profound logic 2012
Profound logic 2012
 
PCTY 2012, How IBM does BYOD v. Martin Vittrup
PCTY 2012, How IBM does BYOD v. Martin VittrupPCTY 2012, How IBM does BYOD v. Martin Vittrup
PCTY 2012, How IBM does BYOD v. Martin Vittrup
 
How did we end up here? Moving beyond the website, iMA 2013
How did we end up here? Moving beyond the website, iMA 2013How did we end up here? Moving beyond the website, iMA 2013
How did we end up here? Moving beyond the website, iMA 2013
 
The Hot Tablet Landscape by Platform, Summer 2011 Version
The Hot Tablet Landscape by Platform, Summer 2011 VersionThe Hot Tablet Landscape by Platform, Summer 2011 Version
The Hot Tablet Landscape by Platform, Summer 2011 Version
 
Layar Augmented Reality Platform - information for brands and publishers
Layar Augmented Reality Platform - information for brands and publishersLayar Augmented Reality Platform - information for brands and publishers
Layar Augmented Reality Platform - information for brands and publishers
 
Samsung's smartphone operating system: bada
Samsung's smartphone operating system: badaSamsung's smartphone operating system: bada
Samsung's smartphone operating system: bada
 
Android and android phones
Android and android phonesAndroid and android phones
Android and android phones
 
MonoTouch 5.2 Introduction
MonoTouch 5.2 IntroductionMonoTouch 5.2 Introduction
MonoTouch 5.2 Introduction
 
ComparingTwo major mobile operating system
ComparingTwo major mobile operating systemComparingTwo major mobile operating system
ComparingTwo major mobile operating system
 
Designing the New Android Experience - The Golden Age of Android
Designing the New Android Experience - The Golden Age of AndroidDesigning the New Android Experience - The Golden Age of Android
Designing the New Android Experience - The Golden Age of Android
 
Android Hardware That's A Little Bit... Odd
Android Hardware That's A Little Bit... OddAndroid Hardware That's A Little Bit... Odd
Android Hardware That's A Little Bit... Odd
 
Pp2
Pp2Pp2
Pp2
 
Intro to Android Development by Philip Peng
Intro to Android Development by Philip PengIntro to Android Development by Philip Peng
Intro to Android Development by Philip Peng
 

Similar to Climbing Mount Android (June 2011)

HIT3328 - Chapter02 - Foundation and Tools
HIT3328 - Chapter02 - Foundation and ToolsHIT3328 - Chapter02 - Foundation and Tools
HIT3328 - Chapter02 - Foundation and ToolsYhal Htet Aung
 
Jan Kroon's talk @mdevcon 2012
Jan Kroon's talk @mdevcon 2012Jan Kroon's talk @mdevcon 2012
Jan Kroon's talk @mdevcon 2012
Jan Kroon
 
Saminar ppt of
Saminar ppt ofSaminar ppt of
Saminar ppt of
Suraj Rajput
 
Android the future
Android  the futureAndroid  the future
Android the future
Sanjeev Kumar Jaiswal
 
All about android
All about androidAll about android
All about android
Inimitable Harish
 
Mobile and Tablet App Development and Market Share
Mobile and Tablet App Development and Market ShareMobile and Tablet App Development and Market Share
Mobile and Tablet App Development and Market Share
Jeremy Callinan
 
First Steps with Android - An Exciting Introduction
First Steps with Android - An Exciting IntroductionFirst Steps with Android - An Exciting Introduction
First Steps with Android - An Exciting Introduction
Cesar Augusto Nogueira
 
Android Workshop Presentation
Android Workshop PresentationAndroid Workshop Presentation
Android Workshop PresentationNAILBITER
 
Android PPT Presentation 2018
Android PPT Presentation 2018Android PPT Presentation 2018
Android PPT Presentation 2018
Rao Purna
 
Android ! BATRA COMPUTER CENTRE
Android ! BATRA COMPUTER CENTREAndroid ! BATRA COMPUTER CENTRE
Android ! BATRA COMPUTER CENTRE
jatin batra
 
Android and android versions
Android and android versionsAndroid and android versions
Android and android versions
Megha Jain
 
Android Architecture and Working
Android Architecture and WorkingAndroid Architecture and Working
Android Architecture and Working
AnkurVeer1
 
Android Workshop Session 1
Android Workshop Session 1Android Workshop Session 1
Android Workshop Session 1NAILBITER
 
Pharma times mobile[2]
Pharma times mobile[2]Pharma times mobile[2]
Pharma times mobile[2]Doctors.net.uk
 
Android and android phones
Android and android phonesAndroid and android phones
Android and android phonesDennise Layague
 
Android platform
Android platform Android platform
Android platform
Rashmi Warghade
 
Mobile Application Development-Lecture 01 & 02.pdf
Mobile Application Development-Lecture 01 & 02.pdfMobile Application Development-Lecture 01 & 02.pdf
Mobile Application Development-Lecture 01 & 02.pdf
AbdullahMunir32
 
Introduction To android
Introduction To androidIntroduction To android
Introduction To android
Zaid Khan
 
Building Native Smartphone Apps with Rhodes
Building Native Smartphone Apps with RhodesBuilding Native Smartphone Apps with Rhodes
Building Native Smartphone Apps with Rhodes
Adam Blum
 

Similar to Climbing Mount Android (June 2011) (20)

HIT3328 - Chapter02 - Foundation and Tools
HIT3328 - Chapter02 - Foundation and ToolsHIT3328 - Chapter02 - Foundation and Tools
HIT3328 - Chapter02 - Foundation and Tools
 
Jan Kroon's talk @mdevcon 2012
Jan Kroon's talk @mdevcon 2012Jan Kroon's talk @mdevcon 2012
Jan Kroon's talk @mdevcon 2012
 
Saminar ppt of
Saminar ppt ofSaminar ppt of
Saminar ppt of
 
Android the future
Android  the futureAndroid  the future
Android the future
 
All about android
All about androidAll about android
All about android
 
Mobile and Tablet App Development and Market Share
Mobile and Tablet App Development and Market ShareMobile and Tablet App Development and Market Share
Mobile and Tablet App Development and Market Share
 
First Steps with Android - An Exciting Introduction
First Steps with Android - An Exciting IntroductionFirst Steps with Android - An Exciting Introduction
First Steps with Android - An Exciting Introduction
 
Android overview
Android overviewAndroid overview
Android overview
 
Android Workshop Presentation
Android Workshop PresentationAndroid Workshop Presentation
Android Workshop Presentation
 
Android PPT Presentation 2018
Android PPT Presentation 2018Android PPT Presentation 2018
Android PPT Presentation 2018
 
Android ! BATRA COMPUTER CENTRE
Android ! BATRA COMPUTER CENTREAndroid ! BATRA COMPUTER CENTRE
Android ! BATRA COMPUTER CENTRE
 
Android and android versions
Android and android versionsAndroid and android versions
Android and android versions
 
Android Architecture and Working
Android Architecture and WorkingAndroid Architecture and Working
Android Architecture and Working
 
Android Workshop Session 1
Android Workshop Session 1Android Workshop Session 1
Android Workshop Session 1
 
Pharma times mobile[2]
Pharma times mobile[2]Pharma times mobile[2]
Pharma times mobile[2]
 
Android and android phones
Android and android phonesAndroid and android phones
Android and android phones
 
Android platform
Android platform Android platform
Android platform
 
Mobile Application Development-Lecture 01 & 02.pdf
Mobile Application Development-Lecture 01 & 02.pdfMobile Application Development-Lecture 01 & 02.pdf
Mobile Application Development-Lecture 01 & 02.pdf
 
Introduction To android
Introduction To androidIntroduction To android
Introduction To android
 
Building Native Smartphone Apps with Rhodes
Building Native Smartphone Apps with RhodesBuilding Native Smartphone Apps with Rhodes
Building Native Smartphone Apps with Rhodes
 

Recently uploaded

A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 

Recently uploaded (20)

A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 

Climbing Mount Android (June 2011)

  • 1. Climbing Mount Android Rajesh Vasa, 2011 Twitter: @rvasa http://www.rvasa.com 1
  • 2. Mobile Eco-System Content Providers (Music/Video/Books) Ad Networks App. Distribution Platform Billing Telephone Handset Cloud Networks OEMs Infrastructure 2 R. Vasa, 2011
  • 3. Android Eco-System Content Providers (Music/Video/Books) Google, Amazon App. Ad Networks ** Distribution Google, Double Click Platform Google Checkout Android Billing Google, Amazon Telephone Handset Cloud Networks (OEMs) Infrastructure Samsung, HTC, Motorola, Sony ... 3 R. Vasa, 2011
  • 4. Focus of this talk... Content Providers (Music/Video/Books) Google, Amazon App. Ad Networks ** Distribution Google, Double Click Android Google Checkout Platform Billing Google, Amazon Telephone Handset Cloud ThisNetworks talk will present a(OEMs) development perspective Infrastructure Samsung, HTC, Motorola, Sony ... 4 R. Vasa, 2011
  • 5. Talk Overview • Devices • What is Android? • Development Tools • The Android Way • Anatomy of a Simple Android Application • An Interactive Android Application • Dealing with Multiple Activities • Activity Life Cycle (the odd thing) 5 R. Vasa, 2011
  • 6. Roadmap - Where are we? • Devices • What is Android? • The Android Way • Anatomy of a Simple Android Application • An Interactive Android Application • Dealing with Multiple Activities • Activity Life Cycle (the odd thing) 6 R. Vasa, 2011
  • 7. Android Device User Interaction Android devices have three key buttons Menu Back Home 7 R. Vasa, 2011
  • 8. Vendors can add additional buttons 8 R. Vasa, 2011
  • 9. There are variations in physical form But all phones have Home, Menu, & Back Buttons 9 R. Vasa, 2011
  • 10. Home Button... • Typically, this will take you back to the Home Screen of the phone • Default behaviour ~ iPhone / iPad button Home 10 R. Vasa, 2011
  • 11. Back Button • This will take you back to the previous screen • If app. has only one screen, this will exit app. Personal Opinion: Back iPhone / iPad should borrow this button 11 R. Vasa, 2011
  • 12. Menu Button • Shows a contextual menu (if one is available) • Developers can write their own menus • Quite handy (but, causes Usability issues) • Low Discoverability Menu (as open) 12 R. Vasa, 2011
  • 13. Android for tablets is slightly different... Action Bar Where is the menu button? Back, Home (Buttons need not be physical in Android) 13 R. Vasa, 2011
  • 14. Tablet Menu Icon Visibility is contextual Menu Sadly, menu position is not mandated (yuk?) 14 R. Vasa, 2011
  • 15. Roadmap - Where are we? • Devices • What is Android? • Development Tools • The Android Way • Anatomy of a Simple Android Application • An Interactive Android Application • Dealing with Multiple Activities • Activity Life Cycle (the odd thing) 15 R. Vasa, 2011
  • 16. What is Android? • Android is a platform • Operating System (with primitive API) • Frameworks (incl. components and libraries) Applications Frameworks Android API Operating System (Customised Linux Kernel) 16 R. Vasa, 2011
  • 17. Android Programming languages: Java, C/C++ Image Source: http://developer.android.com 17 R. Vasa, 2011
  • 18. Android is a bi-lingual platform C/C++ Java Image Source: http://www.tbray.org 18 R. Vasa, 2011
  • 19. Most Android Code is in Java (but...) ≠ Android Java is not 100% Sun Java 19 R. Vasa, 2011
  • 20. Android Java is different (in many ways) No RMI No Bytecode No AWT / Swing UI Different 2D/3D libs Different Class Load Mechanism 20 R. Vasa, 2011
  • 21. Roadmap - Where are we? • Devices • What is Android? • Development Tools • The Android Way • Anatomy of a Simple Android Application • An Interactive Android Application • Dealing with Multiple Activities • Activity Life Cycle (the odd thing) 21 R. Vasa, 2011
  • 22. Development Tools • Android SDK (Compiler and Emulator) • Eclipse IDE + Android Plug-in • Powerful debugger • Visual UI Builder • Ant (Build System) Download from http://developer.android.com 22 R. Vasa, 2011
  • 23. Eclipse IDE 23 R. Vasa, 2011
  • 24. Eclipse IDE - Graphical UI Editor 24 R. Vasa, 2011
  • 25. Android Emulator Permits checking Portrait and Landscape views 25 R. Vasa, 2011
  • 26. Emulator is nice .. but phone is better • The emulator runs the Android O/S (you can run any version: 1.6 to 3.0) • Emulates the phone hardware (like VM Ware) • Emulator does not have sensors (e.g. GPS, Gyro, Accelerometer, Cell phone etc.) • It however offers ways to simulate these events • make a phone call to it So, I can send an SMS to the emulator or 26 R. Vasa, 2011
  • 27. Emulators Vs Simulator • iOS offers a simulator • Android has gone down the emulator path • Trade-offs (pros and cons), • Simulators start-up faster, good enough • Emulators allow closer to phone hardwareof the O/S easily + checking against rel. 1.6 • Emulators and Simulators cannot mimic real CPU speed, disk speed, network speed etc. (yet!) 27 R. Vasa, 2011
  • 28. If your Java is rusty Free e-Book: http://www.mindview.net/Books/TIJ/ 28 R. Vasa, 2011
  • 29. Roadmap - Where are we? • Devices • What is Android? • Development Tools •The Android Way • Anatomy of a Simple Android Application • An Interactive Android Application • Dealing with Multiple Activities • Activity Life Cycle (the odd thing) 29 R. Vasa, 2011
  • 30. The Android Way Convention Configuration Development is organised around a few conventions 30 R. Vasa, 2011
  • 31. Android Project Structure (convention) •Source code (src) •Generated code (gen) •Resources (res) •Images (drawable) •Layout of app (layout) •Constants/Strings (values) 31 R. Vasa, 2011
  • 32. Needs Resources @Multiple Resolutions Convention High Low Medium 32 R. Vasa, 2011
  • 33. Roadmap - Where are we? • Devices • What is Android? • Development Tools • The Android Way • Anatomy of a Simple Android Application • An Interactive Android Application • Dealing with Multiple Screens (Activities) • Activity Life Cycle (interesting design choice) 33 R. Vasa, 2011
  • 34. A Simple Android App. 34 R. Vasa, 2011
  • 35. What is involved? • Place UI controls (Text and Image) • Layout the controls • Centre text • Make text large font • Display Image to take up all space 35 R. Vasa, 2011
  • 36. Each Screen is an Activity • Android app. is made up of Activities Activity 36 R. Vasa, 2011
  • 37. Views are Android’s Key UI Building Block • We need two views on the Activity TextView ImageView 37 R. Vasa, 2011
  • 38. Views are Placed inside a View Group • Different types of pre-defined layouts • Linear, Relative, Table, Frame etc.. View Group a.k.a Layout 38 R. Vasa, 2011
  • 39. Android App. - Building Blocks Activity Layout Views (View Group) 39 R. Vasa, 2011
  • 40. Separation of Concerns in Android Presentation Functionality Layout Definition Activity Class (main.xml) Event Handling, I/O ... 40 R. Vasa, 2011
  • 41. UI (Layout) Definition • Layout definition is generally in an XML file • Hand coded or Visual Editor • Can be also be done in Java Code (yuk!) Layout Definition XML File 41 R. Vasa, 2011
  • 42. Android Offers a number of UI Controls • Offers all standard controls and lot more... Progress These are a small subset of available controls 42 R. Vasa, 2011
  • 43. View Groups and Layouts • Android offers the following View Groups, • Linear Layout (Horizontal or Vertical) • Absolute Layout (You set X, Y for each View) • Table Layout (Rows and Columns) • Relative Layout ( ) Position relative to other Views • Frame Layout (Show only one view at a time) • Scroll View (Permits scrolling of the screen) •View Groups can be nested 43 R. Vasa, 2011
  • 44. Generated Code, Layout & Resources • How did Australia image get into the App.? • How did we set the text to “Australia”? • Conventions • Layout Defined in /layout/main.xml • Resources Placed in /res/drawable-* • String values defined in/values/strings.xml 44 R. Vasa, 2011
  • 45. Resources Resources in “res” Convention 45 R. Vasa, 2011
  • 46. Resources are given a unique ID A unique reference id to resources is generated by the Android SDK tools Convention 46 R. Vasa, 2011
  • 47. Resources and Generated IDs Generated Code static final int australia=0x7f020000; 47 R. Vasa, 2011
  • 48. A Reference to Layout also Generated All References are Integers 48 R. Vasa, 2011
  • 49. Identifiers are used to access resources This is the Activity Class Reference to the layout (Android Runtime will Render this Layout) 49 R. Vasa, 2011
  • 50. Layout is Referred to from Java Code Activity Activity Class (Java) View Group (Layout) Layout Definition (main.xml) 50 R. Vasa, 2011
  • 51. Who writes the Activity code? This block of code is created by IDE/SDK when we create new Android project You can also write you own 51 R. Vasa, 2011
  • 52. Activity Creation Method called (by Application Launcher) when App is first launched 52 R. Vasa, 2011
  • 53. Activity Creation - Layout Rendering Method call will pass the reference to the layout that needs to be rendered on the screen (“Rendering” is a two-pass process: measure and draw) 53 R. Vasa, 2011
  • 54. What is the “root” Activity? • How does Android know which Activity to create first? Answer: Application Manifest File 54 R. Vasa, 2011
  • 55. Application Manifest File Application Icon Reference Activity Name Category 55 R. Vasa, 2011
  • 56. Application Manifest File Category indicates that it can be launched 56 R. Vasa, 2011
  • 57. Application Manifest File Main action indicates that it is the starting point 57 R. Vasa, 2011
  • 58. Layouts and String Information • How did we set the text to “Australia” String constant 58 R. Vasa, 2011
  • 59. Using Graphical Resources • How did the Australia image get into layout? Layout can refer to resources @drawable is a special tag 59 R. Vasa, 2011
  • 60. What is it with the @ tag? • Constant Resources in Android can be referred using the “@” tag in XML layout • Example: @drawable, @string ... @drawable/australia @drawable/bots 60 R. Vasa, 2011
  • 61. @ Tag and Multiple Screen Resolutions • Dealing with multiple screen resolutions @drawable/icon Android Runtime decides best resource to use based on hardware capabilities R. Vasa, 2011
  • 62. Significance of hdpi/ldpi/mdpi Different resolution images High-Res, 240 dpi screen Low-Res, 120 dpi screen Med-Res, 160 dpi screen 62 R. Vasa, 2011
  • 63. Roadmap - Where are we? • Devices • What is Android? • Development Tools • The Android Way • Anatomy of a Simple Android Application • An Interactive Android Application • Dealing with Multiple Screens (Activities) • Life Cycle & interesting design choices 63 R. Vasa, 2011
  • 64. Building an App with Simple Interaction • Temperature Conversion (C -> F) 64 R. Vasa, 2011
  • 65. Views TextView EditText Button TextView 4 Views (UI components) using a Linear Layout 65 R. Vasa, 2011
  • 66. Linear Layout (View Group) main.xml (Layout) 66 R. Vasa, 2011
  • 67. View Identifiers • We need a way to identify components that we created in the layout • E.g. To read input data from the field @+id TAG creates new identifiers 67 R. Vasa, 2011
  • 68. UI Interaction Handling Pattern • Component.setOn......Listener ( handler ) • E.g. button.setOnClickListener • Handler is an anonymous inner class • On...Listener handler = new On....Listener() {} 68 R. Vasa, 2011
  • 69. UI Interaction Handling Pattern The View identifiers are defined in XML 69 R. Vasa, 2011
  • 70. Roadmap - Where are we? • Devices • What is Android? • Development Tools • The Android Way • Anatomy of a Simple Android Application • An Interactive Android Application • Dealing with Multiple Screens (Activities) • Life Cycle & interesting design choices 70 R. Vasa, 2011
  • 71. Wiring up Multiple Activities Contact List Activity Contact Details Select Back 71 R. Vasa, 2011
  • 72. Activities are Stacked in Android • All current activities are placed on a Stack • Newly started activities come into foreground Foreground/Active Contact Details Back button will Background/ pop top most starts Paused activity from stack Contact List 72 R. Vasa, 2011
  • 73. Activities are like mini-processes • Android activities have their own life cycle • Asynchronous Messaging Communication between Activities is done by message Contact List Contact Details 73 R. Vasa, 2011
  • 74. Async. messaging called “Intents” intent Contact List Contact Details Activities communicate with each other via Intents 74 R. Vasa, 2011
  • 75. Async. messaging called “Intents” Activity-X Photo Viewer view photo intent You can send a general purpose message (intent), all applications capable of handling that Intent will respond Framework prescribes conventions for common intents 75 R. Vasa, 2011
  • 76. Roadmap - Where are we? • Devices • What is Android? • Development Tools • The Android Way • Anatomy of a Simple Android Application • An Interactive Android Application • Dealing with Multiple Screens (Activities) •Life Cycle (& interesting design choices) 76 R. Vasa, 2011
  • 77. Android Activities are Managed by O/S Application Activities have a parent application Activity-A Activity-B Activity-C Activity has Life Cycle Application is NOT managed directly by the O/S Life Cycle is Managed by Android Framework 77 R. Vasa, 2011
  • 78. Android Activity Life Cycle Activity is re-started when orientation changes Developers have to save and retrieve state if orientation changes 78 R. Vasa, 2011
  • 79. Security -- Android Devices has User UID (User ID) also has determines Android File System Access Application Permissions The UID is generated at install time based on the signature and package name 79 R. Vasa, 2011
  • 80. A Short Plug!!! 80 R. Vasa, 2011
  • 81. Mobile Development @ Swinburne • HIT8328 - Software Development for Mobile Devices • Android focused • HIT8329 - Creating Data Driven Mobile Applications We Offer • iOS focused Options to Study • Portfolio Based Assessments Just One Subject • We do not just cover API -- thereyoua to learn) conceptual foundation (prepare is strong Teaching material will be available openly shortly 81 R. Vasa, 2011
  • 82. Mobile Development @ Swinburne • HIT8328 - Software Development for Mobile Devices •Applications HIT8329 - Creating Data Driven Mobile Teaching material will be available under an open license shortly Follow @rvasa or @swinfict for update 82 R. Vasa, 2011