2 Androidoverview
2 Androidoverview
Android Overview
Android (Google) is a widely anticipated open
source operating system for mobile devices,
Supporting
Bluetooth (wireless for short distance)
Wi-Fi (wireless for 150 feet indoors, 300 ft outdoors)
3G(200 kbits/sec) and 4G (100 Mbit -1Gbit/sec)
Android Architecture
Library Layer
System C libraries and function Libraries, supporting
multimedia, web browser, SQLite... Native Services to
hardware
Android runtime
Dalvik Virtual Machine
Executes files in the Dalvik Executable (.dex) format
Java core Libraries
Provides most of the functionality of the Java
programming language.
Java core libraries rely on the Dalvik VM and the
underlying Linux kernel
Every Android application runs in its own process, with
its own instance of the Dalvik virtual machine
Applications Layer
A set of core applications shipped with Android platform
an email client, SMS program, calendar, maps,
browser, contacts, and others
All written in Java
User applications are also here
Features of Android
Cont.
Limitations
screen size
battery life time
processor capacity
Slow network access and Web browser
Input: soft keyboard, phone keypad, touch
screen, or stylus
Security
Activity
Activities provide a user interface for one
specific task, Basic component of most
applications
Most applications have several activities
that start each other as needed
Each is implemented as a subclass of the
base Activity class
Service
Services execute background processing, no
visual interface
Ex: Downloads, Playing Music, TCP/UDP Server
You can bind to an existing service, control its
operation, and run in background
Play music, alarm clock, etc.
Secured if using permissions
Callers may need to verify that service is the
correct one
Content provider
ContentProviders
Broadcast receivers
Broadcast receivers act as mailboxes for
messages from other applications. It receives
and reacts to broadcast announcements
If an app registered the receiver in adv., the
event will notify and call back the registered
software
Ex: Low battery, power connected, shutdown,
timezone changed, etc.
Broadcast receivers
Act as receivers for multiple components
Provide secure IPC
Done by specifying permissions on
BroadcastReceiver regarding sender
Otherwise, behave like activities in terms of IPC
Cant define permission
Dont send sensitive data
Services
Can terminate via stopSelf(); or
Context.stopService();
Content Providers
Are only active when responding to ContentResolvers
Broadcast Receivers
Are only active when responding to broadcasts
Intent
Intent is a goal action component which takes care of
the process of inter-components communication
(ICC)
Intent is simply a message object containing a
destination component address and data
Protection
Each application executes as its own user identity,
such that OS provides system-level isolation;
Android middleware contains a reference monitor that
mediates the inter-component communication (ICC).
Intent(cont.)
Intent action:
Start an Activity
Broadcast events or changes
Start, stop, resume. or communicate with
background Services
Access data held by ContentProviders
Call back to handle events
Carry data with Extras (key, value)
Intent Filters
Used to determine recipient of Intent
Specify the main entrance for activities
A user interface consists of a series of
Activities
Each Activity is a screen.
Intent may leave a security flaw (hole)
Solution: Intents explicitly define
receiver
Goal
Understand applications and their
components
Concepts:
activity,
service,
broadcast receiver,
content provider,
intent,
AndroidManifest
@2011 Mihail L. Sichitiu
24
Applications
Written in Java (its possible to write native
code will not cover that here)
Good separation (and corresponding security)
from other applications:
Each application runs in its own process
Each process has its own separate VM
Each application is assigned a unique Linux user ID
by default files of that application are only visible
to that application (can be explicitly exported)
@2011 Mihail L. Sichitiu
25
Application Components
Activities visual user interface focused
on a single thing a user can do
Services no visual interface they run in
the background
Broadcast Receivers receive and react
to broadcast announcements
Content Providers allow data exchange
between applications
26
Activities
Basic component of most applications
Most applications have several activities
that start each other as needed
Each is implemented as a subclass of the
base Activity class
27
Services
Does not have a visual interface
Runs in the background indefinitely
Examples
Network Downloads
Playing Music
TCP/UDP Server
Broadcast Receivers
Receive and react to broadcast
announcements
Extend the class BroadcastReceiver
Examples of broadcasts:
Low battery, power connected, shutdown,
timezone changed, etc.
Other applications can initiate broadcasts
30
Content Providers
Makes some of the application data available
to other applications
Its the only way to transfer data between
applications in Android (no shared files,
shared memory, pipes, etc.)
Extends the class ContentProvider;
Other applications use a ContentResolver
object to access the data provided via a
ContentProvider
31
Intents
An intent is an Intent object with a message content.
Activities, services and broadcast receivers are started
by intents. ContentProviders are started by
ContentResolvers:
An activity is started by Context.startActivity(Intent intent) or
Activity.startActivityForResult(Intent intent, int RequestCode)
A service is started by Context.startService(Intent service)
An application can initiate a broadcast by using an Intent in any
of Context.sendBroadcast(Intent intent),
Context.sendOrderedBroadcast(), and
Context.sendStickyBroadcast()
32
Services
Can terminate via stopSelf(); or Context.stopService();
Content Providers
Are only active when responding to ContentResolvers
Broadcast Receivers
Are only active when responding to broadcasts
33
Android Manifest
34
Intent Filters
Shows in the
Launcher and
is the main
activity to
start
Handles JPEG
images in
some way
35
Android Permissions
All permission of Androids policy are set at install time
and cant change until the application is reinstalled.
Androids permission only restricts access to
components and doesnt currently provide information
flow guarantees.
A permission is listed in apps manifest definition XML
file.
If a public component doesnt explicitly declare any
access permission, Android permits any application to
access it.
Component As ability to access components B and C is
determined by comparing the access permission labels
on B and C to the collection of permission labels
assigned to application A.
Permissions Levels
User can assign permissions to applications at
- normal
dangerous
signature
signatureOrSystem
http://developer.android.com/guide/developin
g/building/index.html#detailed-build
Reference
1.http://www.businessweek.com/technology/content/oct2010/tc20
101020_639668.htm
2. http://it-jobs.fins.com/Articles/SB129606993144879991/MobileApp-Developers-Wanted-at-Ad-Agencies
3.http://www.gartner.com/it/page.jsp?id=1466313
4.http://developer.android.com/guide/developing/index.html
5.Android Overview, http://www.google.com/url?
sa=t&rct=j&q=&esrc=s&source=web&cd=7&ved=0CEcQFjAG&url=h
ttp%3A%2F%2Fai.arizona.edu%2Fmis510%2Fslides%2FAndroid
%2520Overview.ppt&ei=4HBXUNPvMuPe0QGm3oCYCg&usg=AF
QjCNE2Li9vyh34rECKYDuOjKjI5pjyzw&sig2=EwfIL1bPNJacCi6ZaAWCA
6. Mobile Application Security on Android, Originally presented by
Jesse Burns at Black Hat 2009