SlideShare ist ein Scribd-Unternehmen logo
1 von 49
Downloaden Sie, um offline zu lesen
Android
Android Application Development
- Ashwin
Agenda
➢ Android Platform Overview
➢ Installation
➢ Building Blocks
➢ Application Development
➢ Development Tools
➢ Source walk through
Introduction to Android
➢ Open software platform for mobile development
➢ A complete stack – OS, Middleware, Applications
➢ An Open Handset Alliance (OHA) project
➢ Powered by Linux operating system
➢ Fast application development in Java
➢ Open source under the Apache 2 license
Installation
System requirements 
Download 
http://ftp.cs.pu.edu.tw/pub/eclipse/eclipse/downloads/drops/R­3.7­201106131736/eclipse­SDK­3.7­
linux­gtk.tar.gz 
http://dl.google.com/android/ADT­12.0.0.zip 
http://dl.google.com/android/android­sdk_r12­linux_x86.tgz 
Installing 
Eclipse 
Untar eclipse­SDK­3.7­linux­gtk.tar.gz . 
Open Handset Alliance
➢ What is the Open Handset Alliance (OHA)? (1)
➢ It's a consortium of several companies
Opportunities
➢ 100s of millions of mobile phone users
➢ Very high growth, esp. in Asia
➢ think 1985 on the desktop (if you were born by then)
➢ no dominant 3rd party developers.... yet
➢ what will the killer app categories be?
➢ what does it mean to have any app + the internet in your
pocket?
➢ You can develop for it today!
Android Versions
➢ Cupcake
➢ Donut
➢ Eclair
➢ Froyo
➢ Gingerbread
➢ Honeycomb
➢ Ice Cream Sandwich
➢ Jelly Bean
Linux Kernel
➢ Works as a HAL
➢ Device drivers
➢ Memory management
➢ Process management
➢ Networking
Libraries
➢ C/C++ libraries
➢ Interface through Java
➢ Surface manager – Handling UI Windows
➢ 2D and 3D graphics
➢ Media codecs, SQLite, Browser engine
Android Run Time
➢ Dalvik VM
➢ Dex files
➢ Compact and efficient than class files
➢ Limited memory and battery power
➢ Core Libraries
➢ Java 5 Std edition
➢ Collections, I/O etc…
Application Framework
➢ API interface
➢ Activity manager – manages application life cycle.
➢ Package Manager
Applications
➢ Built in and user apps
➢ Can replace built in apps
Development Tools
➢ Eclipse
➢ Android SDK
➢
3rd
Party Add On's
Emulator
➢ QEMU-based ARM emulator
➢ Runs the same image as the device
➢ Limitations:
➢ No Camera support
Installation
 http://developer.android.com/sdk/installing/index.html
 http://onthefencedevelopment.com/blog/installing-eclipse-and-and
 http://sharepointkunskap.wordpress.com/2012/05/11/install-
android-sdk-and-eclipse-in-ubuntu-12-04/
 http://kittipatkampa.wordpress.com/2012/01/17/how-to-install-
eclipse-and-android-sdk-on-ubuntu-10-04-lts/
 http://www.wikihow.com/Install-Android-on-Ubuntu-Linux-
With-Eclipse-Ide
Building Blocks
➢ Activity
➢ Service
➢ Intent and IntentFilters
➢ Content Providers
➢ Processes and Threads
Activity
➢ Typically correspond to one UI screen
➢ But, they can:
✔ Be faceless
✔ Be in a floating window
✔ Return a value
Activity Life Cycle
Activity Life Cycle
➢ OnCreate
➢ OnStart
➢ OnResume
➢ OnPause
➢ OnStop
➢ OnDestroy
Application Lifecycle
➢ Application run in their own processes
(VM, PID)
➢ Processes are started and stopped as
needed to run an application's
components
➢ Processes may be killed to reclaim
resources
Security
➢ Each application runs in its own process
➢ Process permissions are enforced at user
and group IDs assigned to processes
➢ Finer grained permissions are then
granted (revoked) per operations
UI Overview
➢ All user interface elements in an Android
app are built using View and ViewGroup
objects.
➢ A View is an object that draws something
on the screen that the user can interact
with.
➢ A ViewGroup is an object that holds other
View (and ViewGroup) objects in order to
define the layout of the interface.
Introducing Layouts
➢ Layout is the architecture for the user
interface in an Activity.It defines the layout
structure and holds all the elements that
appear to the user.
➢ You can declare your layout in two ways:
➢ Declare UI elements in XML
➢ Instantiate layout elements at
runtime
Layouts
➢ Linear Layout: A view group that aligns all
children in a single direction, vertically or
horizontally. You can specify the layout
direction with the android:orientation
attribute.
➢ Relative Layout:RelativeLayout is a view
group that displays child views in relative
positions. The position of each view can
be specified as relative to sibling
elements.
Layouts
➢ FrameLayout: The simplest of the Layout Managers, the
Frame Layout simply pins each child view to the top left
corner. Adding multiple children stacks each new child
on top of the previ-ous, with each new View obscuring
the last.
➢ GridLayout: A layout that places its children in a
rectangular grid.
➢ TableLayout: A layout that arranges its children into
rows and columns.
Layout Classes
➢ AbsoluteLayout In an Absolute Layout, each child View’s
position is defined in absolute coor-dinates. Using this
class, you can guarantee the exact layout of your
components, but at a price.
View
➢ This class represents the basic building
block for user interface components.
➢ Provides classes that expose basic user
interface classes that handle screen layout
and interaction with the user.
➢ View is the base class for widgets, which
are used to create interactive UI
components (buttons, text fields, etc.)
Input Control
➢ Button : A push-button that can be pressed, or clicked,
by the user to perform an action.
➢ Text field : An editable text field. You can use the
AutoCompleteTextView widget to create a text entry
widget that provides auto-complete suggestions
➢ Checkbox : An on/off switch that can be toggled by the
user. You should use checkboxes when presenting users
with a group of selectable options that are not mutually
exclusive.
➢ Radio button : Similar to checkboxes, except that only
one option can be selected in the group.
➢ Toggle button : An on/off button with a light indicator.
Input Control
➢ Spinner: A drop-down list that allows users to select one
value from a set.
➢ Pickers : A dialog for users to select a single value for a
set by using up/down buttons or via a swipe gesture.
Use a DatePickercode> widget to enter the values for the
date (month, day, year) or a TimePicker widget to enter
the values for a time (hour, minute, AM/PM), which will
be formatted automatically for the user's locale.
➢ ImageView
➢ ProgressBar
List View
➢ A view that shows items in a vertically
scrolling list.
➢ The items come from the ListAdapter
associated with this view.
Adapter
➢ An Adapter object acts as a bridge between an
AdapterView and the underlying data for that view.
➢ The Adapter provides access to the data items.
➢ AdapterView objects have two main responsibilities:
* Filling the layout with data
* Handling user selections
Grid View
➢ GridView is a ViewGroup that displays items in a two-
dimensional, scrollable grid.
➢ The grid items are automatically inserted to the layout
using a ListAdapter.
Applications have common structure
Views such as lists,
grids, text boxes,
buttons, and even an
embeddable web
browser
Content Providers
that enable
applications to
access data from
other applications
(such as Contacts),
or to share their own
data
An Activity Manager that
manages the life cycle of
applications and provides a
common navigation
backstack
A Notification Manager that
enables all apps to display
custom alerts in the status bar
A Resource Manager,
providing access to non-
code resources such as
localized strings, graphics,
and layout files
Applications have common structure
Broadcast
receivers can
trigger intents that
start an application
Data storage
provide data for
your apps, and can
be shared between
apps – database,
file, and shared
preferences (hash
map) used by
group of
applications
Activity is the presentation
layer of your app: there will
be one per screen, and the
Views provide the UI to the
activity
Intents specify what
specific action should be
performed
Services run in the
background and have no
UI for the user – they will
update data, and trigger
events
Compilation
Write app in Java
Compiled in Java
Transformed to Dalvik bytecode
Linux OS
Loaded into Dalvik VM
Dalvik VM
Run multiple VMs efficiently
Each app has its own VM
Minimal memory footprint
Hardware
➢ Turn on "USB Debugging" on your device.
➢ Settings > Applications > Development and
enable USB debugging
➢ Set up your system to detect your device.
e.
➢ Log in as root and create this file:
/etc/udev/rules.d/51-android.rules.
➢ SUBSYSTEM=="usb",
ATTR{idVendor}=="0bb4", MODE="0666",
GROUP="plugdev"
Intents
➢ Think of Intents as a verb and object; a
description of what you want done
➢ E.g. VIEW, CALL, PLAY etc..
➢ System matches Intent with Activity that
can best provide the service
➢ Activities and IntentReceivers describe
what Intents they can service
Intents
GMail
Contacts
Home
Blogger
Chat
Client component makes a
request for a specific action
“Pick photo”
Picasa
System picks best
component for that actionNew components can use
existing functionalityBlogger
Photo Gallery
Intent Receivers
➢ Components that respond to broadcast
‘Intents’
➢ Way to respond to external notification or
alarms
➢ Apps can invent and broadcast their own
Intent
Services
➢ Faceless components that run in the
background
➢ E.g. music player, network download etc…
Service Life Cycle
➢ Bound And UnBound Service
➢ A facility for the application to tell the
system about something it wants to be
doing in the background
➢ A bound service allows components (such
as activities) to bind to the service, send
requests, receive responses, and even
perform interprocess communication
(IPC).
Shared Preferences
➢ A class provides a general framework that
allows you to save and retrieve persistent
key-value pairs of primitive data types.
➢ Can save any primitive data: booleans,
floats, ints, longs, and strings. This data
will persist across user sessions (even if
your application is killed).
Content Providers
➢ Enables sharing of data across
applications
➢ E.g. address book, photo gallery
➢ Provides uniform APIs for:
➢ querying
➢ delete, update and insert.
➢ Content is represented by URI and MIME
type
Notifications
➢ Several types of situations may arise that
require you to notify the user about an
event that occurs in your application.
➢ When an event such as saving a file is
complete, a small message should appear to
confirm that the save was successful.
➢ If the application is performing work that the
user must wait for (such as loading a file), the
application should show a hovering progress
wheel or bar.
Location Manager
➢ This class provides access to
the system location services.
Hardware Oriented Features

Feature Description
Camera A class that enables your application to interact with the camera to snap a photo, acquire images for a preview
screen, and modify parameters used to govern how the camera operates.
Sensor Class representing a sensor. Use getSensorList(int) to get the list of available Sensors.
SensorManager A class that permits access to the sensors available within the Android platform.
SensorEventListener An interface used for receiving notifications from the SensorManager when sensor values have changed. An
application implements this interface to monitor one or more sensors available in the hardware.
SensorEvent This class represents a sensor event and holds information such as the sensor type (e.g., accelerometer,
orientation, etc.), the time-stamp, accuracy and of course the sensor's data.
MediaRecorder A class, used to record media samples, that can be useful for recording audio activity within a specific location
(such as a baby nursery). Audio clippings can also be analyzed for identification purposes in an access-control
or security application. For example, it could be helpful to open the door to your time-share with your voice,
rather than having to meet with the realtor to get a key.
GeomagneticField This class is used to estimated estimate magnetic field at a given point on Earth, and in particular, to compute
the magnetic declination from true north.
FaceDetector A class that permits basic recognition of a person's face as contained in a bitmap. Using this as a device lock
means no more passwords to remember — biometrics capability on a cell phone.
Getting Started
➢ http://developer.android.com/index.html
➢ Blog http://android-
developers.blogspot.com/ which has lots
of useful examples
➢ http://www.anddev.org

Weitere ähnliche Inhalte

Ähnlich wie Android by Swecha

OS in mobile devices [Android]
OS in mobile devices [Android]OS in mobile devices [Android]
OS in mobile devices [Android]Yatharth Aggarwal
 
Android Jumpstart Jfokus
Android Jumpstart JfokusAndroid Jumpstart Jfokus
Android Jumpstart JfokusLars Vogel
 
Android App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structureAndroid App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structureVijay Rastogi
 
Dori waldman android _course
Dori waldman android _courseDori waldman android _course
Dori waldman android _courseDori Waldman
 
android training_material ravy ramio
android training_material ravy ramioandroid training_material ravy ramio
android training_material ravy ramioslesulvy
 
Anatomy of android application
Anatomy of android applicationAnatomy of android application
Anatomy of android applicationNikunj Dhameliya
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android DevelopmentAly Abdelkareem
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions newJoe Jacob
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspectiveGunjan Kumar
 
Android Development project
Android Development projectAndroid Development project
Android Development projectMinhaj Kazi
 
Dori waldman android _course_2
Dori waldman android _course_2Dori waldman android _course_2
Dori waldman android _course_2Dori Waldman
 
Android Workshop
Android WorkshopAndroid Workshop
Android WorkshopJunda Ong
 
Part 2 android application development 101
Part 2 android application development 101Part 2 android application development 101
Part 2 android application development 101Michael Angelo Rivera
 
11.11.2020 - Unit 5-3 ACTIVITY, MENU AND SQLITE DATABASE.pptx
11.11.2020 - Unit 5-3  ACTIVITY, MENU AND SQLITE DATABASE.pptx11.11.2020 - Unit 5-3  ACTIVITY, MENU AND SQLITE DATABASE.pptx
11.11.2020 - Unit 5-3 ACTIVITY, MENU AND SQLITE DATABASE.pptxMugiiiReee
 
MD-IV-CH-ppt.ppt
MD-IV-CH-ppt.pptMD-IV-CH-ppt.ppt
MD-IV-CH-ppt.pptbharatt7
 
Android studio
Android studioAndroid studio
Android studioAndri Yabu
 
Android Application Development Using Java
Android Application Development Using JavaAndroid Application Development Using Java
Android Application Development Using Javaamaankhan
 

Ähnlich wie Android by Swecha (20)

OS in mobile devices [Android]
OS in mobile devices [Android]OS in mobile devices [Android]
OS in mobile devices [Android]
 
Android Jumpstart Jfokus
Android Jumpstart JfokusAndroid Jumpstart Jfokus
Android Jumpstart Jfokus
 
Android
AndroidAndroid
Android
 
Android App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structureAndroid App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structure
 
Dori waldman android _course
Dori waldman android _courseDori waldman android _course
Dori waldman android _course
 
android training_material ravy ramio
android training_material ravy ramioandroid training_material ravy ramio
android training_material ravy ramio
 
Anatomy of android application
Anatomy of android applicationAnatomy of android application
Anatomy of android application
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions new
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspective
 
Android Development project
Android Development projectAndroid Development project
Android Development project
 
Dori waldman android _course_2
Dori waldman android _course_2Dori waldman android _course_2
Dori waldman android _course_2
 
Android Intro
Android IntroAndroid Intro
Android Intro
 
Android Workshop
Android WorkshopAndroid Workshop
Android Workshop
 
Part 2 android application development 101
Part 2 android application development 101Part 2 android application development 101
Part 2 android application development 101
 
11.11.2020 - Unit 5-3 ACTIVITY, MENU AND SQLITE DATABASE.pptx
11.11.2020 - Unit 5-3  ACTIVITY, MENU AND SQLITE DATABASE.pptx11.11.2020 - Unit 5-3  ACTIVITY, MENU AND SQLITE DATABASE.pptx
11.11.2020 - Unit 5-3 ACTIVITY, MENU AND SQLITE DATABASE.pptx
 
Android TCJUG
Android TCJUGAndroid TCJUG
Android TCJUG
 
MD-IV-CH-ppt.ppt
MD-IV-CH-ppt.pptMD-IV-CH-ppt.ppt
MD-IV-CH-ppt.ppt
 
Android studio
Android studioAndroid studio
Android studio
 
Android Application Development Using Java
Android Application Development Using JavaAndroid Application Development Using Java
Android Application Development Using Java
 

Mehr von Swecha | స్వేచ్ఛ (6)

Intro to Free Software | Swecha
Intro to Free Software | SwechaIntro to Free Software | Swecha
Intro to Free Software | Swecha
 
Intro to OpenClipArt - by Swecha
Intro to OpenClipArt - by SwechaIntro to OpenClipArt - by Swecha
Intro to OpenClipArt - by Swecha
 
Inkscape - A brief
Inkscape - A briefInkscape - A brief
Inkscape - A brief
 
Bala Swecha-Bridging the Digital Divide
Bala Swecha-Bridging the Digital DivideBala Swecha-Bridging the Digital Divide
Bala Swecha-Bridging the Digital Divide
 
Polymer Web Framework - Swecha Boot Camp
Polymer Web Framework - Swecha Boot CampPolymer Web Framework - Swecha Boot Camp
Polymer Web Framework - Swecha Boot Camp
 
Mongo db
Mongo dbMongo db
Mongo db
 

Android by Swecha

  • 2. Agenda ➢ Android Platform Overview ➢ Installation ➢ Building Blocks ➢ Application Development ➢ Development Tools ➢ Source walk through
  • 3. Introduction to Android ➢ Open software platform for mobile development ➢ A complete stack – OS, Middleware, Applications ➢ An Open Handset Alliance (OHA) project ➢ Powered by Linux operating system ➢ Fast application development in Java ➢ Open source under the Apache 2 license
  • 5. Open Handset Alliance ➢ What is the Open Handset Alliance (OHA)? (1) ➢ It's a consortium of several companies
  • 6.
  • 7. Opportunities ➢ 100s of millions of mobile phone users ➢ Very high growth, esp. in Asia ➢ think 1985 on the desktop (if you were born by then) ➢ no dominant 3rd party developers.... yet ➢ what will the killer app categories be? ➢ what does it mean to have any app + the internet in your pocket? ➢ You can develop for it today!
  • 8. Android Versions ➢ Cupcake ➢ Donut ➢ Eclair ➢ Froyo ➢ Gingerbread ➢ Honeycomb ➢ Ice Cream Sandwich ➢ Jelly Bean
  • 9. Linux Kernel ➢ Works as a HAL ➢ Device drivers ➢ Memory management ➢ Process management ➢ Networking
  • 10. Libraries ➢ C/C++ libraries ➢ Interface through Java ➢ Surface manager – Handling UI Windows ➢ 2D and 3D graphics ➢ Media codecs, SQLite, Browser engine
  • 11. Android Run Time ➢ Dalvik VM ➢ Dex files ➢ Compact and efficient than class files ➢ Limited memory and battery power ➢ Core Libraries ➢ Java 5 Std edition ➢ Collections, I/O etc…
  • 12. Application Framework ➢ API interface ➢ Activity manager – manages application life cycle. ➢ Package Manager
  • 13. Applications ➢ Built in and user apps ➢ Can replace built in apps
  • 14. Development Tools ➢ Eclipse ➢ Android SDK ➢ 3rd Party Add On's
  • 15. Emulator ➢ QEMU-based ARM emulator ➢ Runs the same image as the device ➢ Limitations: ➢ No Camera support
  • 16. Installation  http://developer.android.com/sdk/installing/index.html  http://onthefencedevelopment.com/blog/installing-eclipse-and-and  http://sharepointkunskap.wordpress.com/2012/05/11/install- android-sdk-and-eclipse-in-ubuntu-12-04/  http://kittipatkampa.wordpress.com/2012/01/17/how-to-install- eclipse-and-android-sdk-on-ubuntu-10-04-lts/  http://www.wikihow.com/Install-Android-on-Ubuntu-Linux- With-Eclipse-Ide
  • 17. Building Blocks ➢ Activity ➢ Service ➢ Intent and IntentFilters ➢ Content Providers ➢ Processes and Threads
  • 18. Activity ➢ Typically correspond to one UI screen ➢ But, they can: ✔ Be faceless ✔ Be in a floating window ✔ Return a value
  • 20. Activity Life Cycle ➢ OnCreate ➢ OnStart ➢ OnResume ➢ OnPause ➢ OnStop ➢ OnDestroy
  • 21. Application Lifecycle ➢ Application run in their own processes (VM, PID) ➢ Processes are started and stopped as needed to run an application's components ➢ Processes may be killed to reclaim resources
  • 22. Security ➢ Each application runs in its own process ➢ Process permissions are enforced at user and group IDs assigned to processes ➢ Finer grained permissions are then granted (revoked) per operations
  • 23. UI Overview ➢ All user interface elements in an Android app are built using View and ViewGroup objects. ➢ A View is an object that draws something on the screen that the user can interact with. ➢ A ViewGroup is an object that holds other View (and ViewGroup) objects in order to define the layout of the interface.
  • 24. Introducing Layouts ➢ Layout is the architecture for the user interface in an Activity.It defines the layout structure and holds all the elements that appear to the user. ➢ You can declare your layout in two ways: ➢ Declare UI elements in XML ➢ Instantiate layout elements at runtime
  • 25. Layouts ➢ Linear Layout: A view group that aligns all children in a single direction, vertically or horizontally. You can specify the layout direction with the android:orientation attribute. ➢ Relative Layout:RelativeLayout is a view group that displays child views in relative positions. The position of each view can be specified as relative to sibling elements.
  • 26. Layouts ➢ FrameLayout: The simplest of the Layout Managers, the Frame Layout simply pins each child view to the top left corner. Adding multiple children stacks each new child on top of the previ-ous, with each new View obscuring the last. ➢ GridLayout: A layout that places its children in a rectangular grid. ➢ TableLayout: A layout that arranges its children into rows and columns.
  • 27. Layout Classes ➢ AbsoluteLayout In an Absolute Layout, each child View’s position is defined in absolute coor-dinates. Using this class, you can guarantee the exact layout of your components, but at a price.
  • 28. View ➢ This class represents the basic building block for user interface components. ➢ Provides classes that expose basic user interface classes that handle screen layout and interaction with the user. ➢ View is the base class for widgets, which are used to create interactive UI components (buttons, text fields, etc.)
  • 29. Input Control ➢ Button : A push-button that can be pressed, or clicked, by the user to perform an action. ➢ Text field : An editable text field. You can use the AutoCompleteTextView widget to create a text entry widget that provides auto-complete suggestions ➢ Checkbox : An on/off switch that can be toggled by the user. You should use checkboxes when presenting users with a group of selectable options that are not mutually exclusive. ➢ Radio button : Similar to checkboxes, except that only one option can be selected in the group. ➢ Toggle button : An on/off button with a light indicator.
  • 30. Input Control ➢ Spinner: A drop-down list that allows users to select one value from a set. ➢ Pickers : A dialog for users to select a single value for a set by using up/down buttons or via a swipe gesture. Use a DatePickercode> widget to enter the values for the date (month, day, year) or a TimePicker widget to enter the values for a time (hour, minute, AM/PM), which will be formatted automatically for the user's locale. ➢ ImageView ➢ ProgressBar
  • 31. List View ➢ A view that shows items in a vertically scrolling list. ➢ The items come from the ListAdapter associated with this view.
  • 32. Adapter ➢ An Adapter object acts as a bridge between an AdapterView and the underlying data for that view. ➢ The Adapter provides access to the data items. ➢ AdapterView objects have two main responsibilities: * Filling the layout with data * Handling user selections
  • 33. Grid View ➢ GridView is a ViewGroup that displays items in a two- dimensional, scrollable grid. ➢ The grid items are automatically inserted to the layout using a ListAdapter.
  • 34. Applications have common structure Views such as lists, grids, text boxes, buttons, and even an embeddable web browser Content Providers that enable applications to access data from other applications (such as Contacts), or to share their own data An Activity Manager that manages the life cycle of applications and provides a common navigation backstack A Notification Manager that enables all apps to display custom alerts in the status bar A Resource Manager, providing access to non- code resources such as localized strings, graphics, and layout files
  • 35. Applications have common structure Broadcast receivers can trigger intents that start an application Data storage provide data for your apps, and can be shared between apps – database, file, and shared preferences (hash map) used by group of applications Activity is the presentation layer of your app: there will be one per screen, and the Views provide the UI to the activity Intents specify what specific action should be performed Services run in the background and have no UI for the user – they will update data, and trigger events
  • 36. Compilation Write app in Java Compiled in Java Transformed to Dalvik bytecode Linux OS Loaded into Dalvik VM
  • 37. Dalvik VM Run multiple VMs efficiently Each app has its own VM Minimal memory footprint
  • 38. Hardware ➢ Turn on "USB Debugging" on your device. ➢ Settings > Applications > Development and enable USB debugging ➢ Set up your system to detect your device. e. ➢ Log in as root and create this file: /etc/udev/rules.d/51-android.rules. ➢ SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"
  • 39. Intents ➢ Think of Intents as a verb and object; a description of what you want done ➢ E.g. VIEW, CALL, PLAY etc.. ➢ System matches Intent with Activity that can best provide the service ➢ Activities and IntentReceivers describe what Intents they can service
  • 40. Intents GMail Contacts Home Blogger Chat Client component makes a request for a specific action “Pick photo” Picasa System picks best component for that actionNew components can use existing functionalityBlogger Photo Gallery
  • 41. Intent Receivers ➢ Components that respond to broadcast ‘Intents’ ➢ Way to respond to external notification or alarms ➢ Apps can invent and broadcast their own Intent
  • 42. Services ➢ Faceless components that run in the background ➢ E.g. music player, network download etc…
  • 43. Service Life Cycle ➢ Bound And UnBound Service ➢ A facility for the application to tell the system about something it wants to be doing in the background ➢ A bound service allows components (such as activities) to bind to the service, send requests, receive responses, and even perform interprocess communication (IPC).
  • 44. Shared Preferences ➢ A class provides a general framework that allows you to save and retrieve persistent key-value pairs of primitive data types. ➢ Can save any primitive data: booleans, floats, ints, longs, and strings. This data will persist across user sessions (even if your application is killed).
  • 45. Content Providers ➢ Enables sharing of data across applications ➢ E.g. address book, photo gallery ➢ Provides uniform APIs for: ➢ querying ➢ delete, update and insert. ➢ Content is represented by URI and MIME type
  • 46. Notifications ➢ Several types of situations may arise that require you to notify the user about an event that occurs in your application. ➢ When an event such as saving a file is complete, a small message should appear to confirm that the save was successful. ➢ If the application is performing work that the user must wait for (such as loading a file), the application should show a hovering progress wheel or bar.
  • 47. Location Manager ➢ This class provides access to the system location services.
  • 48. Hardware Oriented Features  Feature Description Camera A class that enables your application to interact with the camera to snap a photo, acquire images for a preview screen, and modify parameters used to govern how the camera operates. Sensor Class representing a sensor. Use getSensorList(int) to get the list of available Sensors. SensorManager A class that permits access to the sensors available within the Android platform. SensorEventListener An interface used for receiving notifications from the SensorManager when sensor values have changed. An application implements this interface to monitor one or more sensors available in the hardware. SensorEvent This class represents a sensor event and holds information such as the sensor type (e.g., accelerometer, orientation, etc.), the time-stamp, accuracy and of course the sensor's data. MediaRecorder A class, used to record media samples, that can be useful for recording audio activity within a specific location (such as a baby nursery). Audio clippings can also be analyzed for identification purposes in an access-control or security application. For example, it could be helpful to open the door to your time-share with your voice, rather than having to meet with the realtor to get a key. GeomagneticField This class is used to estimated estimate magnetic field at a given point on Earth, and in particular, to compute the magnetic declination from true north. FaceDetector A class that permits basic recognition of a person's face as contained in a bitmap. Using this as a device lock means no more passwords to remember — biometrics capability on a cell phone.
  • 49. Getting Started ➢ http://developer.android.com/index.html ➢ Blog http://android- developers.blogspot.com/ which has lots of useful examples ➢ http://www.anddev.org