Professional Documents
Culture Documents
2011-08-01
Dept. of Computer Science & Engineering, The Chinese University of Hong Kong
Outline
What is Android? Android application components Android boot sequence Binder: Inter-process communication Conclusion
Dept. of Computer Science & Engineering, The Chinese University of Hong Kong
Dept. of Computer Science & Engineering, The Chinese University of Hong Kong
Android History
Google acquired Android Inc. in Aug. 2005 Open Handset Alliance: Nov. 2007
1.0 : Oct. 2008 2.3 Gingerbread: Dec. 2010 3.0 Honeycomb: Feb. 2011
A tablet-oriented release
Cloud Client?
4
Dept. of Computer Science & Engineering, The Chinese University of Hong Kong
Open source Memory management, Process management Permission-based security model Driver model Shared libraries
Bionic libc: custom libc implementation, optimized for embedded use Apache license, version 2
Dept. of Computer Science & Engineering, The Chinese University of Hong Kong
Android Architecture
APPLICATIONS (Java)
Home Screen Phone Browser
View System
ANDROID RUNTIME
Core Libraries (Java) Dalvik Virtual Machine
SQLite
WebKit libc
OpenGL | ES SGL
FreeType SSL
Dept. of Computer Science & Engineering, The Chinese University of Hong Kong
Dept. of Computer Science & Engineering, The Chinese University of Hong Kong
Outline
What is Android? Android application components Android boot sequence Binder: Inter-process communication Conclusion
Dept. of Computer Science & Engineering, The Chinese University of Hong Kong
Android Application
Android application is component-based .apk
Application manifest
AndroidManifest.xml
Dept. of Computer Science & Engineering, The Chinese University of Hong Kong
Service
Content Provider
Broadcast Receiver
Dept. of Computer Science & Engineering, The Chinese University of Hong Kong
10
(1) Activity
Activity Manager
View System
The presentation layer of Android application Every screen or window is an extension of the android.app.Activity class Activities use Views to form GUI
Dept. of Computer Science & Engineering, The Chinese University of Hong Kong
11
Dept. of Computer Science & Engineering, The Chinese University of Hong Kong
12
Intent
A message-passing mechanism
Intent intent = new Intent(MyActivity.this, MyOtherActivity.class); startActivity(intent); Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:31634257")); startActivity(intent);
Dept. of Computer Science & Engineering, The Chinese University of Hong Kong
13
(2) Service
android.app.Service Faceless components that run in the background Used to perform regular processing that needs to continue even when applications Activities arent active or visible E.g. music player, network download, etc.
Dept. of Computer Science & Engineering, The Chinese University of Hong Kong
14
Content Providers
android.content.ContentProvider Shareable data store Provide an interface for publishing and consuming data
Based around a simple URI addressing model using the content:// schema
Decouple the application layer from the data layer Native Content Providers
Dept. of Computer Science & Engineering, The Chinese University of Hong Kong
Dept. of Computer Science & Engineering, The Chinese University of Hong Kong
16
Outline
What is Android? Android application components Android boot sequence Binder: Inter-process communication Conclusion
Dept. of Computer Science & Engineering, The Chinese University of Hong Kong
17
Package Manager
Home
Home Dalvik VM
Service Manager
Dalvik VM
Dept. of Computer Science & Engineering, The Chinese University of Hong Kong
Outline
What is Android? Android application components Android boot sequence Binder: Inter-process communication Conclusion
Dept. of Computer Science & Engineering, The Chinese University of Hong Kong
19
Android Task
Process A Task
Activity
Process B
Activity
Activity
Content Provider
.apk package
Service
.apk package
Dept. of Computer Science & Engineering, The Chinese University of Hong Kong
20
Linux/UNIX
Android
Dept. of Computer Science & Engineering, The Chinese University of Hong Kong
21
Android Binder
High performance through shared memory Per-process thread pool for processing requests Mapping of object references across processes Android Interface Definition Language (AIDL)
Dept. of Computer Science & Engineering, The Chinese University of Hong Kong
22
Binder
Client
IXXX
Service Manager
service list
Server
onTransact()
thread pool
Name:Handle
Name:Handle Name:Handle
Handle=0 transact()
23
Conclusions
Android is a software platform for mobile devices working as cloud clients Android is not GNU/Linux Android application is component-based
Android uses Zygote to fork processes Android Binder driver is its IPC mechanism
Dept. of Computer Science & Engineering, The Chinese University of Hong Kong
24
Dept. of Computer Science & Engineering, The Chinese University of Hong Kong
25