Android architecture
Trang 1Android Architecture
Trang 2• Overview
• Applications
• Application Framework
• Library and Android Runtime
• Linux kernel
Trang 3Overview
Trang 4• Set of necessary application
– Core application of Android include: Home, Browser, Camera
• Your ability:
– Create new applications
– Replace default applications
– Use exist applications for your purposes
Ex: your application want to get a picture from camera So call Camera of Android through intent component
Trang 5Application Framework
• Provide API to create UI
• Provide API to access system services
• Provide API to get resource
• Content provider
Trang 6Application Framework
• UI API: views
– Typical view: view like Button, EditText,
ListView…
– ViewGroup: extends View but can contain more than one view like LinearLayout,
FrameLayout
– Special View: Android support WebView and MapView:
• WebView do the job of browser
• MapView a special view use google map API
Trang 7Application Framework
• System services:
– Get system services:
getSystemService(String)
– Total 20 system services
– Some services:
• LocationManager: get GPS location
• PowerManager: controll power
• SensorManager: access sensors
• WifiManager: manage Wifi access
• …
Trang 8Application Framework
• Resources:
– Resource is non-code file like image, xml…
– Resource include application resource and
system resource:
• Application resource: files in res folder
• System resource: access through R.android
– To access drawable resource of Android, use R.android.drawable.resourcename
– More resource name at http://www.screaming-penguin.com/info/android_drawables/android_drawab les.html
Trang 9Application Framework
• Content Provider
– Store and retrieve data and make it accessible
to all applications
– Is the only way to communicate between
applications
– Data kept by content provider can be modified by:
• Adding new records
• Adding new values to exist records
• Batch updating exist records
• Deleting exist records
Trang 10• C/C++ libraries including:
– System C library
– Media libraries: support playback and record many audio and video format including
MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG
– Sureface Manager: manages access to the display subsystem and seamlessly
composites 2D and 3D graphic layers from multiple applications
– LibWebCore: a modern web browser engine which powers both the Android browser and
an embeddable web view
Trang 11• C/C++ libraries including:
– SGL: the underlying 2D graphics engine
– 3D libraries: an implementation based on OpenGL
ES 1.0 APIs
– SQLite: a powerful and lightweight relational
database engine available to all applications
– FreeType: bitmap and vector font rendering
Trang 12Android runtime
• Core java libraries
• Dalvik Virtual Machine
– Thread and memory manager – Optimize memory usage
– Run many virtual machine
Trang 13• Linux kernel with system services:
– Security
– Memory and process management – Network stack
• Provide driver to access hardware:
– Camera
– Display and audio
– Wifi
– …
Trang 14The end