Dr Jeyakesavan Veerasamy Sr Lecturer University of Texas at Dallas jeyvutdallasedu Agenda Introduction to Android devices Environment overview Android concepts Application components Activities Services Content providers Broadcast receivers ID: 743118
Download Presentation The PPT/PDF document "Android OS : Core Concepts" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Android OS : Core Concepts
Dr. Jeyakesavan Veerasamy
Sr. Lecturer
University of Texas at Dallas
jeyv@utdallas.eduSlide2
Agenda
Introduction to Android devices
Environment overview
Android concepts
Application components
Activities, Services, Content providers, Broadcast receivers
“Hello” application
SummarySlide3
Development Environment
Java Development Kit (JDK)
Eclipse IDE
Android Development Tools (ADT) plug-in
SDK starter package
Platforms (1.0, 2.0, 3.0, 4.1, …)Tools (debug, …)
Reference: http://developer.android.com/sdk/installing.html
JDK
Eclipse
ADTPlug-in
Android
SDKSlide4
Development Process for Android ApplicationsSlide5
Android ArchitectureSlide6
Android Runtime Environment
Dalvik VM for each application
common Linux kernel
JRE
x.class
y.class
Linux kernel
VM
VM
APP
APP
…Slide7
Basics: UNIX security
compare it with Windows securitySlide8
Application Security
Android operating system is based on multi-user Linux system.
Each application
is
treated as a different user. Each application uses unique Linux user ID.Every application runs as a Linux process.Slide9
Application security …
It's possible to arrange for two applications to share the same Linux user ID, in which case they are able to access each other's
files – can run as same
Linux process and share the same VM
(applications use
same certificate). An application can request permission to access device data such as the user's contacts, SMS messages, the mountable storage (SD card), camera, Bluetooth, and more. All application permissions must be granted by the user at install time. Slide10
Processes & Threads
Every application runs in its own process and all components of the application run in that process, by default -- UI thread
Any slow, blocking operations in an activity should be done in a new thread, to avoid slowing down the user interface.
If application does not respond in 5 seconds, "
application not responding
" (ANR) dialog appears.Slide11
Process lifecycle: Importance Hierarchy
Foreground process
Visible process
Service process
Background
processEmpty process
“Lower importance” tasks may be killed by Android – why?How to select a lucky one from a pool? Slide12
IPC
Remote procedure calls (RPCs)Slide13
Android Application components
Activities - front-end UI screens
Services – back-end support
Content providers – application data
SQLite, web or SD card
Broadcast receivers – handle system eventsSlide14
Activitating Components: IntentSlide15
Basics: Data Exchange
A1
A3
A2
A4Slide16
Basics: Data Exchange
Binary or text data
XML or JSON …
Independent data checkers tools available.
A1
A3
A2
A4Slide17
Sample XML data file
Text format:
Belgian Waffles, 5.95, two of our famous Belgian Waffles with plenty of real … , 650
Strawberry Belgian Waffles, 7.95, light Belgian waffles covered with …., 900Slide18
Application info: Manifest file
Declare components
Declare application requirements
Application Resources?Slide19
Activity lifecycle: 3 states
Resumed or Running
Paused
StoppedSlide20
State machineSlide21
CodeSlide22
Service
LifecycleSlide23
User Interface DesignSlide24
XML Layouts
Declare UI elements in XML
. Android provides a straightforward XML vocabulary that corresponds to the View classes and subclasses.
Instantiate layout elements at runtime
. Your application can create View and ViewGroup objects (and manipulate their properties) programmatically. Slide25
Application ResourcesSlide26
Building & running Android appSlide27
Program to say “Hello!”Slide28
Native Development Kit (NDK)
Use C/C++ for development
primarily for performance critical componentsSlide29
Summary
Clean,
sophsticated
, yet reasonably simple.
Android requires strong Java skills – heavy use of derived classes (inheritance).
Development: Java code & XML definitionsReference:
http://developer.android.com/sdk/installing.htmlInstall Android development environment and play with a few examples or try your own ideas!Marketable skill in the industry!Slide30
More references
http://www.vogella.de/articles/AndroidIntent/article.html
http://developer.android.com/resources/browser.html?tag=sampleSlide31
Questions & Answers
jeyv@utdallas.edu