SlideShare a Scribd company logo
F-3697
F-3697
BSP Developer Must Know about
Android
F-3697
Revision History
Revision No. Description Date
V1.0 • Android concepts for BSP developer, by Yone Xie 2012-07-19
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 2
F-3697
Security Level: Confidential A
F-3697
Agenda
 Intro⊿
 Android Architecture
 Linux Kernel
 Native Libraries
 Android Runtime
 Application Framework
 Android Applications
 Android Concepts
 Key Concepts
 Start-up Walkthrough
 Layer Interaction
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 3
Security Level: Confidential A
F-3697
History
 1.0 - September 23, 2008
 1.5 - Cupcake
 1.6 - Donut
 2.1 - Eclair
 2.2 - Froyo
 2.3 - Gingerbread
 3.x - Honeycomb
 4.0 - Ice Scream Sandwich
 4.1 - Jelly Bean
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 4
Security Level: Confidential A
F-3697
AOSP(Android Open Source Project)
 At every new version, Google releases its source code through this
project so that community and vendors can work with it.
 One major exception: Honeycomb has not been released because Google
stated that its source code was not clean enough to release it.
 One can fetch the source code and contribute to it, even though
the development process is very locked by Google
 Only a few devices are supported through AOSP though, only the
two most recent Android development phones, the Panda board
and the Motorola Xoom.
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 5
Security Level: Confidential A
F-3697
Agenda
 Intro
 Android Architecture ⊿
 Linux Kernel
 Native Libraries
 Android Runtime
 Application Framework
 Android Applications
 Android Concepts
 Key Concepts
 Start-up Walkthrough
 Layer Interaction
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 6
Security Level: Confidential A
F-3697
Android Architecture
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 7
Security Level: Confidential A
Applications
Launcher2 Contacts Phone Browser ...
Libraries
Surface Manager Media Framework SQLite
Open GL | ES FreeType WebKit
SGL SSL Bionic
Android Runtime
Core
Libraries
Dalvik
Virtual Machine
Linux Kernel
Display Driver Camera Driver Bluetooth Driver Binder (IPC)
Driver
USB Driver Keypad/Touch
Driver WiFi Driver Power
Management
Shared Memory
Driver
Audio Driver
Application Framework
Activity Manager Window Manager Content
Provider View System
Package Manager Telephony
Manager
Resource
Manager …
Location Manager
Notification
Manager
F-3697
Linux Kernel
 Used as the foundation of the Android system
 Why Linux kernel?
 But, Android is not Linux
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 8
Security Level: Confidential A
Linux Kernel
Display Driver Camera Driver Bluetooth Driver Binder (IPC)
Driver
USB Driver Keypad/Touch
Driver WiFi Driver Power
Management
Shared Memory
Driver
Audio Driver
F-3697
Linux Kernel
 Android vs. Linux Distributions
X No native window GUI system (GNOME/KDE)
X No glibc support
X Does not include the full set of standard Linux utilities
 Standard Linux Kernel (version 2.6+)
X Patches of “kernel enhancements” to support Android
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 9
Security Level: Confidential A
Linux Kernel
Display Driver Camera Driver Bluetooth Driver Binder (IPC)
Driver
USB Driver Keypad/Touch
Driver WiFi Driver Power
Management
Shared Memory
Driver
Audio Driver
F-3697
Kernel Patches
 Kernel patches for Android by Google
 Alarm
 Ashmem
 Binder
 Power Management
 Low Memory Killer
 Kernel Debugger
 Logger
 These changes are beginning to go into the staging/ area of the kernel, as of
3.3, after being a complete fork for a long time
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 10
Security Level: Confidential A
Linux Kernel
Display Driver Camera Driver Bluetooth Driver Binder (IPC)
Driver
USB Driver Keypad/Touch
Driver WiFi Driver Power
Management
Shared Memory
Driver
Audio Driver
F-3697
Binder : Problem
 Why need Binder IPC mechanisms?
 Applications and Services may run in separate processes but must
communicate and share data
 Inter-process communication (IPC) can introduce significant processing
overhead and security holes
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 11
Security Level: Confidential A
Linux Kernel
Display Driver Camera Driver Bluetooth Driver Binder (IPC)
Driver
USB Driver Keypad/Touch
Driver WiFi Driver Power
Management
Shared Memory
Driver
Audio Driver
F-3697
Binder : Solution
 Binder IPC mechanisms
 Driver to facilitate IPC
 High performance through shared memory
 Per-process thread pool for processing requests
 Reference counting, and mapping of object references across processes
 Synchronous calls between processes
 “In the Android platform, the binder is used for nearly everything that
happens across processes in the core platform. "
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 12
Security Level: Confidential A
Linux Kernel
Display Driver Camera Driver Bluetooth Driver Binder (IPC)
Driver
USB Driver Keypad/Touch
Driver WiFi Driver Power
Management
Shared Memory
Driver
Audio Driver
F-3697
Binder in Action
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 13
Security Level: Confidential A
Process A
App A Context Binder Driver
Process B
Service B
Get service
Service
Call foo (object)
Call Return
Marshal proxy
object
Relay to
IPC threads
F-3697
Binder
 How to use Binder from App developer’s view?
 Intent
 Android Interface Definition Language (AIDL)
 http://developer.android.com/guide/components/aidl.html
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 14
Security Level: Confidential A
Linux Kernel
Display Driver Camera Driver Bluetooth Driver Binder (IPC)
Driver
USB Driver Keypad/Touch
Driver WiFi Driver Power
Management
Shared Memory
Driver
Audio Driver
F-3697
PM : Problem
 Why Android need special power management?
 Mobile devices run on battery power
 Batteries have limited capacity
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 15
Security Level: Confidential A
Linux Kernel
Display Driver Camera Driver Bluetooth Driver Binder (IPC)
Driver
USB Driver Keypad/Touch
Driver WiFi Driver Power
Management
Shared Memory
Driver
Audio Driver
F-3697
PM : Solution
 Why Android need special power management?
 Built on top of standard Linux Power Management (PM)
 More aggressive power management policy
 Components make requests to keep the power on through “wake locks”
 Supports different types of wake locks
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 16
Security Level: Confidential A
Linux Kernel
Display Driver Camera Driver Bluetooth Driver Binder (IPC)
Driver
USB Driver Keypad/Touch
Driver WiFi Driver Power
Management
Shared Memory
Driver
Audio Driver
F-3697
Android PM in Action
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 17
Security Level: Confidential A
App A Power Manager PM Driver
NewWake Lock
PARTIAL
CreateWake Lock
Release
Release
Turn Off
CPU
Turn Off
LCD
F-3697
Android PM
 How to use Android PM from App developer’s view?
 android.os.PowerManager
 Use wake locks carefully!
 userActivity(long when, …)
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 18
Security Level: Confidential A
Linux Kernel
Display Driver Camera Driver Bluetooth Driver Binder (IPC)
Driver
USB Driver Keypad/Touch
Driver WiFi Driver Power
Management
Shared Memory
Driver
Audio Driver
F-3697
Get Linux Kernel for Android
 Get kernel source from Google, Depending on which kernel you
want
 git clone https://android.googlesource.com/kernel/common.git
 git clone https://android.googlesource.com/kernel/exynos.git
 git clone https://android.googlesource.com/kernel/goldfish.git
 git clone https://android.googlesource.com/kernel/msm.git
 git clone https://android.googlesource.com/kernel/omap.git
 git clone https://android.googlesource.com/kernel/samsung.git
 git clone https://android.googlesource.com/kernel/tegra.git
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 19
Security Level: Confidential A
Linux Kernel
Display Driver Camera Driver Bluetooth Driver Binder (IPC)
Driver
USB Driver Keypad/Touch
Driver WiFi Driver Power
Management
Shared Memory
Driver
Audio Driver
F-3697
Native Libraries
 Gather a lot of Android-specific libraries to interact at a low-level
with the system(such as HAL), but third-parties libraries as well
 Bionic LibC
 Function Libraries
 Native Servers
 Hardware Abstraction Libraries
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 20
Security Level: Confidential A
Libraries
Surface Manager Media Framework SQLite
Open GL | ES FreeType WebKit
SGL SSL Bionic
Android Runtime
Core
Libraries
Dalvik
Virtual Machine
F-3697
Bionic
 What is bionic?
 Custom libc implementation, optimized for embedded use.
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 21
Security Level: Confidential A
Libraries
Surface Manager Media Framework SQLite
Open GL | ES FreeType WebKit
SGL SSL Bionic
Android Runtime
Core
Libraries
Dalvik
Virtual Machine
F-3697
Bionic : Problem
 Why build a custom libc library?
 License: Google wants to keep GPL out of user-space
 Size: will load in each process, so it needs to be small
 Fast: limited CPU power means it should to be fast
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 22
Security Level: Confidential A
Libraries
Surface Manager Media Framework SQLite
Open GL | ES FreeType WebKit
SGL SSL Bionic
Android Runtime
Core
Libraries
Dalvik
Virtual Machine
F-3697
Bionic : Solution
 Bionic is :
 BSD License
 Small size and fast code paths
 Very fast and small custom pthread implementation
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 23
Security Level: Confidential A
Libraries
Surface Manager Media Framework SQLite
Open GL | ES FreeType WebKit
SGL SSL Bionic
Android Runtime
Core
Libraries
Dalvik
Virtual Machine
F-3697
Bionic
 Built-in support for important Android-specific services
 Access to system properties
 getprop(“my.system.property”, buff, default);
 setprop (“my.system.property”, value);
 Logging events in the system logs
 LOGD(“Logging a message with priority ‘Debug’”);
 LOGW(“Logging a message with priority ‘Warning’”);
 LOGE(“Logging a message with priority ‘Error’”);
 LOGI(“Logging a message with priority ‘Info’”);
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 24
Security Level: Confidential A
F-3697
Bionic
 Bionic C library with the following weirdness :
 Non POSIX
 No support for locales
 No support for wide chars (i.e. multi-byte characters)
 Comes with its own smallish implementation of pthreads based on Linux
futexes
 C++ exceptions are not supported
 pthread cancellation is NOT supported
 Several functions are just stubs (i.e. runtime weirdness may happen)
 Non standard /etc config files
 Dynamic user/groups management (no pam, group, passwd or shadow)
 No fstab
 No SysV init
 All native code must be compiled against bionic
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 25
Security Level: Confidential A
F-3697
Function Libraries
 Media Framework
 Based on Stagefright platform (Android introduces Stagefright to replace
OpenCORE start from Eclair)
 Supports standard video, audio, still-frame formats
 Support for hardware / software codec plug-ins
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 26
Security Level: Confidential A
Libraries
Surface Manager Media Framework SQLite
Open GL | ES FreeType WebKit
SGL SSL Bionic
Android Runtime
Core
Libraries
Dalvik
Virtual Machine
F-3697
Function Libraries
 SQLite
 Light-weight transactional data store
 Back end for most platform data storage
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 27
Security Level: Confidential A
Libraries
Surface Manager Media Framework SQLite
Open GL | ES FreeType WebKit
SGL SSL Bionic
Android Runtime
Core
Libraries
Dalvik
Virtual Machine
F-3697
Function Libraries
 Open GL | ES
 3D graphics engine
 An implementation based on OpenGL ES 1.0 APIs
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 28
Security Level: Confidential A
Libraries
Surface Manager Media Framework SQLite
Open GL | ES FreeType WebKit
SGL SSL Bionic
Android Runtime
Core
Libraries
Dalvik
Virtual Machine
F-3697
Function Libraries
 SGL
 Scalable Graphics Library (Skia Graphics Library)
 2D graphics engine
 low-level graphics library implemented in native code that handles
rendering - Text, Geometries, and Images
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 29
Security Level: Confidential A
Libraries
Surface Manager Media Framework SQLite
Open GL | ES FreeType WebKit
SGL SSL Bionic
Android Runtime
Core
Libraries
Dalvik
Virtual Machine
F-3697
Function Libraries
 FreeType
 A font rasterization engine, used to render text to bitmaps and provides
support for other font-related operations
 http://freetype.org
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 30
Security Level: Confidential A
Libraries
Surface Manager Media Framework SQLite
Open GL | ES FreeType WebKit
SGL SSL Bionic
Android Runtime
Core
Libraries
Dalvik
Virtual Machine
F-3697
Function Libraries
 SSL
 Open SSL library, an open-source implementation of the SSL and TLS
protocols
 http://openssl.org
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 31
Security Level: Confidential A
Libraries
Surface Manager Media Framework SQLite
Open GL | ES FreeType WebKit
SGL SSL Bionic
Android Runtime
Core
Libraries
Dalvik
Virtual Machine
F-3697
Function Libraries
 Webkit
 Based on open source WebKit browser - http://webkit.org
 Renders pages in full (desktop) view
 Full CSS, JavaScript, DOM, AJAX support
 Support for single-column and adaptive view rendering
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 32
Security Level: Confidential A
Libraries
Surface Manager Media Framework SQLite
Open GL | ES FreeType WebKit
SGL SSL Bionic
Android Runtime
Core
Libraries
Dalvik
Virtual Machine
F-3697
Native Services
 Surface Flinger
 Provides system-wide surface “composer”, handling all surface rendering to
frame buffer device
 Can combine 2D and 3D surfaces and surfaces from multiple applications
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 33
Security Level: Confidential A
Libraries
Surface Manager Media Framework SQLite
Open GL | ES Audio Manager WebKit
SGL SSL Bionic
Android Runtime
Core
Libraries
Dalvik
Virtual Machine
F-3697
Native Services
 Surface Flinger
 Surfaces passed as buffers via Binder IPC calls
 Can use OpenGL ES and 2D hardware accelerator for its compositions
 Double-buffering using page-flip (and Triple-buffering introduced from Jelly
Bean)
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 34
Security Level: Confidential A
Libraries
Surface Manager Media Framework SQLite
Open GL | ES Audio Manager WebKit
SGL SSL Bionic
Android Runtime
Core
Libraries
Dalvik
Virtual Machine
F-3697
Typical Graphical Stacks
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 35
Security Level: Confidential A
F-3697
Surface Flinger
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 36
Security Level: Confidential A
F-3697
Native Services
 Audio Flinger
 Manages all audio output devices
 Processes multiple audio streams into PCM audio out paths
 Handles audio routing to various outputs
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 37
Security Level: Confidential A
Libraries
Surface Manager Media Framework SQLite
Open GL | ES Audio Manager WebKit
SGL SSL Bionic
Android Runtime
Core
Libraries
Dalvik
Virtual Machine
F-3697
Audio Flinger
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 38
Security Level: Confidential A
F-3697
Hardware Abstract Layer
Graphics Audio/Camera WiFi /GPS/
Bluetooth RIL ...
HAL
 Hardware Abstraction Layer / Libraries
 Where is it?
 Usually, the kernel already provides a HAL for user-space
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 39
Security Level: Confidential A
Libraries
Surface Manager Media Framework SQLite
Open GL | ES FreeType WebKit
SGL SSL Bionic
Android Runtime
Core
Libraries
Dalvik
Virtual Machine
Linux Kernel
Display Driver Camera Driver Bluetooth Driver Binder (IPC)
Driver
USB Driver Keypad/Touch
Driver WiFi Driver Power
Management
Shared Memory
Driver
Audio Driver
F-3697
HAL : Problem
 Why do Android need a user-space HAL?
 Kernel drivers are GPL which exposes any proprietary IP
 Not all components have standardized kernel driver interfaces
 Android has specific requirements for hardware drivers
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 40
Security Level: Confidential A
Linux Kernel
Display Driver Camera Driver Bluetooth Driver Binder (IPC)
Driver
USB Driver Keypad/Touch
Driver WiFi Driver Power
Management
Shared Memory
Driver
Audio Driver
Hardware Abstract Layer
Graphics Audio/Camera WiFi /GPS/
Bluetooth RIL ...
F-3697
HAL : Solution
 Android HAL :
 Defines the interface that Android requires hardware “drivers” to
implement
 Separates the Android platform logic from the hardware interface
 And Google implemented its HAL with dynamically loaded user-space
libraries
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 41
Security Level: Confidential A
Linux Kernel
Display Driver Camera Driver Bluetooth Driver Binder (IPC)
Driver
USB Driver Keypad/Touch
Driver WiFi Driver Power
Management
Shared Memory
Driver
Audio Driver
Hardware Abstract Layer
Graphics Audio/Camera WiFi /GPS/
Bluetooth RIL ...
F-3697
HAL : Details
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 42
Security Level: Confidential A
 Loading and Interfacing Methods
 dlopen() - loading through HAL
 Linker-loaded .so files
 Hardcoded dlopen()s
 Sockets
 Sysfs entries
 /dev nodes
 D-Bus
F-3697
HAL : Details
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 43
Security Level: Confidential A
 HAL Header Example
// must be provided by each Acme hardware implementation
typedef struct {
int (*foo)( void );
char (*bar)( void );
...
} AcmeFunctions;
const AcmeFunctions *Acme_Init(const struct Env *env, int argc,
char **argv);
F-3697
HAL : Details
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 44
Security Level: Confidential A
 Libraries are loaded dynamically at runtime as needed
dlHandle = dlopen(“/system/lib/libacme.so”, RTLD_NOW);
...
acmeInit = (const AcmeFunctions *(*)(const struct Env *,
int, char **))dlsym(dlHandle, ”Acme_Init");
...
acmeFuncs = acmeInit(&env, argc, argv);
F-3697
HAL : Details
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 45
Security Level: Confidential A
F-3697
HAL : Details
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 46
Security Level: Confidential A
F-3697
Android Runtime
 Handles the execution of Android applications
 Almost entirely written from scratch by Google
 Contains Dalvik, the virtual machine that executes every application that
you run on Android, and the core library for the Java runtime, coming from
Apache Harmony project
 Also contains system daemons, init executable, basic binaries, etc.
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 47
Security Level: Confidential A
Libraries
Surface Manager Audio Manager SQLite
Open GL | ES FreeType WebKit
SGL SSL Bionic
Android Runtime
Core
Libraries
Dalvik
Virtual Machine
F-3697
Application Framework
 Provides an API for developers to create applications
 Exposes all the needed subsystems by providing an abstraction
 Allows to easily use databases, create services, expose data to
other applications, receive system events, etc.
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 48
Security Level: Confidential A
Application Framework
Activity Manager Window Manager Content
Provider View System
Package Manager Telephony
Manager
Resource
Manager …
Location Manager
Notification
Manager
F-3697
Application Framework
 Activity manager
 Manage the life cycle of applications
 Content Provider
 Share data between applications
 Resource Manager
 Manager non-code resource
 Notification Manager
 Display custom alerts in the status bar
 Views System
 A rich and extensible set, which can construct UI
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 49
Security Level: Confidential A
F-3697
Android Applications
 AOSP also comes with a set of applications such as the phone
application, a browser, a contact management application, an
email client, etc.
 However, the Google apps and the Android Market app aren’t
free software, so they are not available in AOSP. To obtain them,
you must contact Google and pass a compatibility test.
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 50
Security Level: Confidential A
Applications
Launcher2 Contacts Phone Browser ...
F-3697
Agenda
 Intro
 Android Architecture
 Linux Kernel
 Native Libraries
 Android Runtime
 Application Framework
 Android Applications
 Android Concepts ⊿
 Key Concepts
 Start-up Walkthrough
 Layer Interaction
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 51
Security Level: Confidential A
F-3697
Android Key Concepts
 APP Developer’s View
 Component
 Activities
 Services
 Broadcast Receivers
 Content Providers
 Intent
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 52
Security Level: Confidential A
F-3697
Start-up Walkthrough
 Runtime Walkthrough
 It all starts with init…
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 53
Security Level: Confidential A
F-3697
Layer Interaction
 There are 3 main flavors of Android layer cake :
 App  Runtime Service  lib
 App  Runtime Service  Native Service  lib
 App  Runtime Service  Native Daemon  lib
Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 54
Security Level: Confidential A
F-3697
Security Level: Confidential A Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 55

More Related Content

PDF
Daur hidup ikan lele by yazid alfa riko
PPTX
PPT Imunologi.pptx
PDF
MATERI PAPARAN DIRJEN DJPT - M Zaini.pdf
PPT
Portinig Application, Drivers And Os
PDF
14180203 an-introduction-to-android
PDF
Slides bootcamp21
PPT
Android
PPTX
PPT on Android
Daur hidup ikan lele by yazid alfa riko
PPT Imunologi.pptx
MATERI PAPARAN DIRJEN DJPT - M Zaini.pdf
Portinig Application, Drivers And Os
14180203 an-introduction-to-android
Slides bootcamp21
Android
PPT on Android

Similar to BSP Developer Must Know about Android.pdf (20)

PPTX
PPT
Rishiraj 's ppt
PPTX
Android OS PPT
PPTX
Android
PPTX
ANDROID MOBILE OPERATING SYSTEM
PDF
Google Io Introduction To Android
PPTX
DOCX
Android
PDF
Android presentation
PPT
Android Anatomy
PPT
Introduction to Android
PPTX
Ami device driver_services ver. 1.1
PDF
Blackberry_runtime_for_android_apps
PPTX
Getting started with android
PPT
Android platform overview
PPT
Android
PPTX
Android architecture
PPT
ANDROID PPT_DAY1.ppt
PDF
Software training report
DOCX
Android..overwiew
Rishiraj 's ppt
Android OS PPT
Android
ANDROID MOBILE OPERATING SYSTEM
Google Io Introduction To Android
Android
Android presentation
Android Anatomy
Introduction to Android
Ami device driver_services ver. 1.1
Blackberry_runtime_for_android_apps
Getting started with android
Android platform overview
Android
Android architecture
ANDROID PPT_DAY1.ppt
Software training report
Android..overwiew
Ad

Recently uploaded (20)

PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPT
Project quality management in manufacturing
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
Digital Logic Computer Design lecture notes
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
additive manufacturing of ss316l using mig welding
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PPTX
Construction Project Organization Group 2.pptx
PDF
composite construction of structures.pdf
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Project quality management in manufacturing
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Embodied AI: Ushering in the Next Era of Intelligent Systems
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Digital Logic Computer Design lecture notes
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Foundation to blockchain - A guide to Blockchain Tech
additive manufacturing of ss316l using mig welding
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Automation-in-Manufacturing-Chapter-Introduction.pdf
Construction Project Organization Group 2.pptx
composite construction of structures.pdf
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Ad

BSP Developer Must Know about Android.pdf

  • 1. F-3697 F-3697 BSP Developer Must Know about Android
  • 2. F-3697 Revision History Revision No. Description Date V1.0 • Android concepts for BSP developer, by Yone Xie 2012-07-19 Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 2 F-3697 Security Level: Confidential A
  • 3. F-3697 Agenda  Intro⊿  Android Architecture  Linux Kernel  Native Libraries  Android Runtime  Application Framework  Android Applications  Android Concepts  Key Concepts  Start-up Walkthrough  Layer Interaction Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 3 Security Level: Confidential A
  • 4. F-3697 History  1.0 - September 23, 2008  1.5 - Cupcake  1.6 - Donut  2.1 - Eclair  2.2 - Froyo  2.3 - Gingerbread  3.x - Honeycomb  4.0 - Ice Scream Sandwich  4.1 - Jelly Bean Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 4 Security Level: Confidential A
  • 5. F-3697 AOSP(Android Open Source Project)  At every new version, Google releases its source code through this project so that community and vendors can work with it.  One major exception: Honeycomb has not been released because Google stated that its source code was not clean enough to release it.  One can fetch the source code and contribute to it, even though the development process is very locked by Google  Only a few devices are supported through AOSP though, only the two most recent Android development phones, the Panda board and the Motorola Xoom. Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 5 Security Level: Confidential A
  • 6. F-3697 Agenda  Intro  Android Architecture ⊿  Linux Kernel  Native Libraries  Android Runtime  Application Framework  Android Applications  Android Concepts  Key Concepts  Start-up Walkthrough  Layer Interaction Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 6 Security Level: Confidential A
  • 7. F-3697 Android Architecture Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 7 Security Level: Confidential A Applications Launcher2 Contacts Phone Browser ... Libraries Surface Manager Media Framework SQLite Open GL | ES FreeType WebKit SGL SSL Bionic Android Runtime Core Libraries Dalvik Virtual Machine Linux Kernel Display Driver Camera Driver Bluetooth Driver Binder (IPC) Driver USB Driver Keypad/Touch Driver WiFi Driver Power Management Shared Memory Driver Audio Driver Application Framework Activity Manager Window Manager Content Provider View System Package Manager Telephony Manager Resource Manager … Location Manager Notification Manager
  • 8. F-3697 Linux Kernel  Used as the foundation of the Android system  Why Linux kernel?  But, Android is not Linux Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 8 Security Level: Confidential A Linux Kernel Display Driver Camera Driver Bluetooth Driver Binder (IPC) Driver USB Driver Keypad/Touch Driver WiFi Driver Power Management Shared Memory Driver Audio Driver
  • 9. F-3697 Linux Kernel  Android vs. Linux Distributions X No native window GUI system (GNOME/KDE) X No glibc support X Does not include the full set of standard Linux utilities  Standard Linux Kernel (version 2.6+) X Patches of “kernel enhancements” to support Android Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 9 Security Level: Confidential A Linux Kernel Display Driver Camera Driver Bluetooth Driver Binder (IPC) Driver USB Driver Keypad/Touch Driver WiFi Driver Power Management Shared Memory Driver Audio Driver
  • 10. F-3697 Kernel Patches  Kernel patches for Android by Google  Alarm  Ashmem  Binder  Power Management  Low Memory Killer  Kernel Debugger  Logger  These changes are beginning to go into the staging/ area of the kernel, as of 3.3, after being a complete fork for a long time Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 10 Security Level: Confidential A Linux Kernel Display Driver Camera Driver Bluetooth Driver Binder (IPC) Driver USB Driver Keypad/Touch Driver WiFi Driver Power Management Shared Memory Driver Audio Driver
  • 11. F-3697 Binder : Problem  Why need Binder IPC mechanisms?  Applications and Services may run in separate processes but must communicate and share data  Inter-process communication (IPC) can introduce significant processing overhead and security holes Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 11 Security Level: Confidential A Linux Kernel Display Driver Camera Driver Bluetooth Driver Binder (IPC) Driver USB Driver Keypad/Touch Driver WiFi Driver Power Management Shared Memory Driver Audio Driver
  • 12. F-3697 Binder : Solution  Binder IPC mechanisms  Driver to facilitate IPC  High performance through shared memory  Per-process thread pool for processing requests  Reference counting, and mapping of object references across processes  Synchronous calls between processes  “In the Android platform, the binder is used for nearly everything that happens across processes in the core platform. " Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 12 Security Level: Confidential A Linux Kernel Display Driver Camera Driver Bluetooth Driver Binder (IPC) Driver USB Driver Keypad/Touch Driver WiFi Driver Power Management Shared Memory Driver Audio Driver
  • 13. F-3697 Binder in Action Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 13 Security Level: Confidential A Process A App A Context Binder Driver Process B Service B Get service Service Call foo (object) Call Return Marshal proxy object Relay to IPC threads
  • 14. F-3697 Binder  How to use Binder from App developer’s view?  Intent  Android Interface Definition Language (AIDL)  http://developer.android.com/guide/components/aidl.html Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 14 Security Level: Confidential A Linux Kernel Display Driver Camera Driver Bluetooth Driver Binder (IPC) Driver USB Driver Keypad/Touch Driver WiFi Driver Power Management Shared Memory Driver Audio Driver
  • 15. F-3697 PM : Problem  Why Android need special power management?  Mobile devices run on battery power  Batteries have limited capacity Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 15 Security Level: Confidential A Linux Kernel Display Driver Camera Driver Bluetooth Driver Binder (IPC) Driver USB Driver Keypad/Touch Driver WiFi Driver Power Management Shared Memory Driver Audio Driver
  • 16. F-3697 PM : Solution  Why Android need special power management?  Built on top of standard Linux Power Management (PM)  More aggressive power management policy  Components make requests to keep the power on through “wake locks”  Supports different types of wake locks Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 16 Security Level: Confidential A Linux Kernel Display Driver Camera Driver Bluetooth Driver Binder (IPC) Driver USB Driver Keypad/Touch Driver WiFi Driver Power Management Shared Memory Driver Audio Driver
  • 17. F-3697 Android PM in Action Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 17 Security Level: Confidential A App A Power Manager PM Driver NewWake Lock PARTIAL CreateWake Lock Release Release Turn Off CPU Turn Off LCD
  • 18. F-3697 Android PM  How to use Android PM from App developer’s view?  android.os.PowerManager  Use wake locks carefully!  userActivity(long when, …) Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 18 Security Level: Confidential A Linux Kernel Display Driver Camera Driver Bluetooth Driver Binder (IPC) Driver USB Driver Keypad/Touch Driver WiFi Driver Power Management Shared Memory Driver Audio Driver
  • 19. F-3697 Get Linux Kernel for Android  Get kernel source from Google, Depending on which kernel you want  git clone https://android.googlesource.com/kernel/common.git  git clone https://android.googlesource.com/kernel/exynos.git  git clone https://android.googlesource.com/kernel/goldfish.git  git clone https://android.googlesource.com/kernel/msm.git  git clone https://android.googlesource.com/kernel/omap.git  git clone https://android.googlesource.com/kernel/samsung.git  git clone https://android.googlesource.com/kernel/tegra.git Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 19 Security Level: Confidential A Linux Kernel Display Driver Camera Driver Bluetooth Driver Binder (IPC) Driver USB Driver Keypad/Touch Driver WiFi Driver Power Management Shared Memory Driver Audio Driver
  • 20. F-3697 Native Libraries  Gather a lot of Android-specific libraries to interact at a low-level with the system(such as HAL), but third-parties libraries as well  Bionic LibC  Function Libraries  Native Servers  Hardware Abstraction Libraries Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 20 Security Level: Confidential A Libraries Surface Manager Media Framework SQLite Open GL | ES FreeType WebKit SGL SSL Bionic Android Runtime Core Libraries Dalvik Virtual Machine
  • 21. F-3697 Bionic  What is bionic?  Custom libc implementation, optimized for embedded use. Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 21 Security Level: Confidential A Libraries Surface Manager Media Framework SQLite Open GL | ES FreeType WebKit SGL SSL Bionic Android Runtime Core Libraries Dalvik Virtual Machine
  • 22. F-3697 Bionic : Problem  Why build a custom libc library?  License: Google wants to keep GPL out of user-space  Size: will load in each process, so it needs to be small  Fast: limited CPU power means it should to be fast Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 22 Security Level: Confidential A Libraries Surface Manager Media Framework SQLite Open GL | ES FreeType WebKit SGL SSL Bionic Android Runtime Core Libraries Dalvik Virtual Machine
  • 23. F-3697 Bionic : Solution  Bionic is :  BSD License  Small size and fast code paths  Very fast and small custom pthread implementation Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 23 Security Level: Confidential A Libraries Surface Manager Media Framework SQLite Open GL | ES FreeType WebKit SGL SSL Bionic Android Runtime Core Libraries Dalvik Virtual Machine
  • 24. F-3697 Bionic  Built-in support for important Android-specific services  Access to system properties  getprop(“my.system.property”, buff, default);  setprop (“my.system.property”, value);  Logging events in the system logs  LOGD(“Logging a message with priority ‘Debug’”);  LOGW(“Logging a message with priority ‘Warning’”);  LOGE(“Logging a message with priority ‘Error’”);  LOGI(“Logging a message with priority ‘Info’”); Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 24 Security Level: Confidential A
  • 25. F-3697 Bionic  Bionic C library with the following weirdness :  Non POSIX  No support for locales  No support for wide chars (i.e. multi-byte characters)  Comes with its own smallish implementation of pthreads based on Linux futexes  C++ exceptions are not supported  pthread cancellation is NOT supported  Several functions are just stubs (i.e. runtime weirdness may happen)  Non standard /etc config files  Dynamic user/groups management (no pam, group, passwd or shadow)  No fstab  No SysV init  All native code must be compiled against bionic Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 25 Security Level: Confidential A
  • 26. F-3697 Function Libraries  Media Framework  Based on Stagefright platform (Android introduces Stagefright to replace OpenCORE start from Eclair)  Supports standard video, audio, still-frame formats  Support for hardware / software codec plug-ins Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 26 Security Level: Confidential A Libraries Surface Manager Media Framework SQLite Open GL | ES FreeType WebKit SGL SSL Bionic Android Runtime Core Libraries Dalvik Virtual Machine
  • 27. F-3697 Function Libraries  SQLite  Light-weight transactional data store  Back end for most platform data storage Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 27 Security Level: Confidential A Libraries Surface Manager Media Framework SQLite Open GL | ES FreeType WebKit SGL SSL Bionic Android Runtime Core Libraries Dalvik Virtual Machine
  • 28. F-3697 Function Libraries  Open GL | ES  3D graphics engine  An implementation based on OpenGL ES 1.0 APIs Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 28 Security Level: Confidential A Libraries Surface Manager Media Framework SQLite Open GL | ES FreeType WebKit SGL SSL Bionic Android Runtime Core Libraries Dalvik Virtual Machine
  • 29. F-3697 Function Libraries  SGL  Scalable Graphics Library (Skia Graphics Library)  2D graphics engine  low-level graphics library implemented in native code that handles rendering - Text, Geometries, and Images Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 29 Security Level: Confidential A Libraries Surface Manager Media Framework SQLite Open GL | ES FreeType WebKit SGL SSL Bionic Android Runtime Core Libraries Dalvik Virtual Machine
  • 30. F-3697 Function Libraries  FreeType  A font rasterization engine, used to render text to bitmaps and provides support for other font-related operations  http://freetype.org Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 30 Security Level: Confidential A Libraries Surface Manager Media Framework SQLite Open GL | ES FreeType WebKit SGL SSL Bionic Android Runtime Core Libraries Dalvik Virtual Machine
  • 31. F-3697 Function Libraries  SSL  Open SSL library, an open-source implementation of the SSL and TLS protocols  http://openssl.org Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 31 Security Level: Confidential A Libraries Surface Manager Media Framework SQLite Open GL | ES FreeType WebKit SGL SSL Bionic Android Runtime Core Libraries Dalvik Virtual Machine
  • 32. F-3697 Function Libraries  Webkit  Based on open source WebKit browser - http://webkit.org  Renders pages in full (desktop) view  Full CSS, JavaScript, DOM, AJAX support  Support for single-column and adaptive view rendering Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 32 Security Level: Confidential A Libraries Surface Manager Media Framework SQLite Open GL | ES FreeType WebKit SGL SSL Bionic Android Runtime Core Libraries Dalvik Virtual Machine
  • 33. F-3697 Native Services  Surface Flinger  Provides system-wide surface “composer”, handling all surface rendering to frame buffer device  Can combine 2D and 3D surfaces and surfaces from multiple applications Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 33 Security Level: Confidential A Libraries Surface Manager Media Framework SQLite Open GL | ES Audio Manager WebKit SGL SSL Bionic Android Runtime Core Libraries Dalvik Virtual Machine
  • 34. F-3697 Native Services  Surface Flinger  Surfaces passed as buffers via Binder IPC calls  Can use OpenGL ES and 2D hardware accelerator for its compositions  Double-buffering using page-flip (and Triple-buffering introduced from Jelly Bean) Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 34 Security Level: Confidential A Libraries Surface Manager Media Framework SQLite Open GL | ES Audio Manager WebKit SGL SSL Bionic Android Runtime Core Libraries Dalvik Virtual Machine
  • 35. F-3697 Typical Graphical Stacks Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 35 Security Level: Confidential A
  • 36. F-3697 Surface Flinger Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 36 Security Level: Confidential A
  • 37. F-3697 Native Services  Audio Flinger  Manages all audio output devices  Processes multiple audio streams into PCM audio out paths  Handles audio routing to various outputs Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 37 Security Level: Confidential A Libraries Surface Manager Media Framework SQLite Open GL | ES Audio Manager WebKit SGL SSL Bionic Android Runtime Core Libraries Dalvik Virtual Machine
  • 38. F-3697 Audio Flinger Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 38 Security Level: Confidential A
  • 39. F-3697 Hardware Abstract Layer Graphics Audio/Camera WiFi /GPS/ Bluetooth RIL ... HAL  Hardware Abstraction Layer / Libraries  Where is it?  Usually, the kernel already provides a HAL for user-space Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 39 Security Level: Confidential A Libraries Surface Manager Media Framework SQLite Open GL | ES FreeType WebKit SGL SSL Bionic Android Runtime Core Libraries Dalvik Virtual Machine Linux Kernel Display Driver Camera Driver Bluetooth Driver Binder (IPC) Driver USB Driver Keypad/Touch Driver WiFi Driver Power Management Shared Memory Driver Audio Driver
  • 40. F-3697 HAL : Problem  Why do Android need a user-space HAL?  Kernel drivers are GPL which exposes any proprietary IP  Not all components have standardized kernel driver interfaces  Android has specific requirements for hardware drivers Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 40 Security Level: Confidential A Linux Kernel Display Driver Camera Driver Bluetooth Driver Binder (IPC) Driver USB Driver Keypad/Touch Driver WiFi Driver Power Management Shared Memory Driver Audio Driver Hardware Abstract Layer Graphics Audio/Camera WiFi /GPS/ Bluetooth RIL ...
  • 41. F-3697 HAL : Solution  Android HAL :  Defines the interface that Android requires hardware “drivers” to implement  Separates the Android platform logic from the hardware interface  And Google implemented its HAL with dynamically loaded user-space libraries Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 41 Security Level: Confidential A Linux Kernel Display Driver Camera Driver Bluetooth Driver Binder (IPC) Driver USB Driver Keypad/Touch Driver WiFi Driver Power Management Shared Memory Driver Audio Driver Hardware Abstract Layer Graphics Audio/Camera WiFi /GPS/ Bluetooth RIL ...
  • 42. F-3697 HAL : Details Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 42 Security Level: Confidential A  Loading and Interfacing Methods  dlopen() - loading through HAL  Linker-loaded .so files  Hardcoded dlopen()s  Sockets  Sysfs entries  /dev nodes  D-Bus
  • 43. F-3697 HAL : Details Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 43 Security Level: Confidential A  HAL Header Example // must be provided by each Acme hardware implementation typedef struct { int (*foo)( void ); char (*bar)( void ); ... } AcmeFunctions; const AcmeFunctions *Acme_Init(const struct Env *env, int argc, char **argv);
  • 44. F-3697 HAL : Details Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 44 Security Level: Confidential A  Libraries are loaded dynamically at runtime as needed dlHandle = dlopen(“/system/lib/libacme.so”, RTLD_NOW); ... acmeInit = (const AcmeFunctions *(*)(const struct Env *, int, char **))dlsym(dlHandle, ”Acme_Init"); ... acmeFuncs = acmeInit(&env, argc, argv);
  • 45. F-3697 HAL : Details Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 45 Security Level: Confidential A
  • 46. F-3697 HAL : Details Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 46 Security Level: Confidential A
  • 47. F-3697 Android Runtime  Handles the execution of Android applications  Almost entirely written from scratch by Google  Contains Dalvik, the virtual machine that executes every application that you run on Android, and the core library for the Java runtime, coming from Apache Harmony project  Also contains system daemons, init executable, basic binaries, etc. Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 47 Security Level: Confidential A Libraries Surface Manager Audio Manager SQLite Open GL | ES FreeType WebKit SGL SSL Bionic Android Runtime Core Libraries Dalvik Virtual Machine
  • 48. F-3697 Application Framework  Provides an API for developers to create applications  Exposes all the needed subsystems by providing an abstraction  Allows to easily use databases, create services, expose data to other applications, receive system events, etc. Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 48 Security Level: Confidential A Application Framework Activity Manager Window Manager Content Provider View System Package Manager Telephony Manager Resource Manager … Location Manager Notification Manager
  • 49. F-3697 Application Framework  Activity manager  Manage the life cycle of applications  Content Provider  Share data between applications  Resource Manager  Manager non-code resource  Notification Manager  Display custom alerts in the status bar  Views System  A rich and extensible set, which can construct UI Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 49 Security Level: Confidential A
  • 50. F-3697 Android Applications  AOSP also comes with a set of applications such as the phone application, a browser, a contact management application, an email client, etc.  However, the Google apps and the Android Market app aren’t free software, so they are not available in AOSP. To obtain them, you must contact Google and pass a compatibility test. Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 50 Security Level: Confidential A Applications Launcher2 Contacts Phone Browser ...
  • 51. F-3697 Agenda  Intro  Android Architecture  Linux Kernel  Native Libraries  Android Runtime  Application Framework  Android Applications  Android Concepts ⊿  Key Concepts  Start-up Walkthrough  Layer Interaction Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 51 Security Level: Confidential A
  • 52. F-3697 Android Key Concepts  APP Developer’s View  Component  Activities  Services  Broadcast Receivers  Content Providers  Intent Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 52 Security Level: Confidential A
  • 53. F-3697 Start-up Walkthrough  Runtime Walkthrough  It all starts with init… Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 53 Security Level: Confidential A
  • 54. F-3697 Layer Interaction  There are 3 main flavors of Android layer cake :  App  Runtime Service  lib  App  Runtime Service  Native Service  lib  App  Runtime Service  Native Daemon  lib Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 54 Security Level: Confidential A
  • 55. F-3697 Security Level: Confidential A Copyright © 2012 MStar Semiconductor, Inc. All rights reserved. 55