Mobile & Embedded Computing Lab
An deep dive into
Android Open Source Project
Siji Sunny
Director, MELabs
siji@melabs.in
Mobile : +91 9820896398
www.melabs.in
www.melabs.in
History
● October 2003 - Android, Inc founded in California by Andy
Rubin, Rich Miner, Nick Sears and Chris White.
● The company's were to develop an advanced operating
system for digital cameras
● August 17, 2005 - Google acquired Android Inc.
● the team led by Rubin developed a mobile device platform
powered by the Linux kernel.
● October 22, 2008 - First Android device launched in the
market.
Ref: Wikipedia
History
www.melabs.in
● Source code available for download-Contains
- Kernel
- Native Libraries
- Android runtime
- Application Framework
● License -Android Open Source Project is the Apache
Software License, Version 2.0 (For userspace).
● Android originated by a group of companies - Open
Handset Alliance, led by Google.
● Freedom to implement your own device ?
- Google Apps are not open-source
- Vendor depended firmware/drivers
Concept- AOSP
Android Open-Source Project
www.melabs.in
www.melabs.in
Architecture
Applications & Framework
Binder IPC
Linux Kernel
Hardware Abstraction Layer
Media Player
Services
Camera Service
Other Services
Window manager
Activity Manager
Notification
Manager
Other Services
System ServerMedia Server
Ref :http://s.android.com/devices/index.html
www.melabs.in
www.melabs.in
Binder-IPC
●Driver to facilitate inter-process communication (IPC)
●Allows high level framework APIs to interact with Android's
system services
●At the application framework level, all of this communication
is hidden from the developer
●High performance through shared memory
www.melabs.in
HAL
●User space C/C++ library layer
●Defines the interface that Android requires hardware
“drivers” to implement
●Separates the Android platform logic from the hardware
interface
Graphics Audio Camera Bluetooth
HARDWARE ABSTRATION LAYER
www.melabs.in
Native Libraries
●Bionic Libc
●Function Libraries (For standard calls)
●Native Servers (for UI/Video/Audios)
●Hardware Abstraction Libraries
WebkitMedia Framework Sqlite Bionic Libc
OpenGL|ES Audio Manager FreeType SSL
LIBRARIES
www.melabs.in
What is Bionic
●Custom libc implementation, optimized for embedded
use.
Why build a custom libc library?
●License: BSD License (Objective was to keep GPL out of
user-space)
●Size: will load in each process, so it needs to be small
●Fast: limited CPU power means we need to be fast
●Small size and fast code paths
●Very fast and small custom pthread implementation
www.melabs.in
Bionic -Disadvantage
●Doesn't support certain POSIX features
●Not compatible with Gnu Libc (glibc)
●All native code must be compiled against bionic
www.melabs.in
Dalvik Vm
● The software that runs the apps on Android devices
● It's fast, even on weak CPUs
● it will run on systems with little memory
● it will run in an energy-efficient way
● Provides application portability and runtime consistency
● Runs optimized file format (.dex) and Dalvik bytecode
● Java .class / .jar files converted to .dex at build time
Compiling & packaging
.java files
source code
.class file .dex file .apk file
Java compiler
javac
Dex compiler
(dx)
Packaging
(aapt)
www.melabs.in
www.melabs.in
Android Runtime
● Bootloader
● Kernel
● Init
● Android runtime Dalvik/Zygote
● System Server
● Activity Manager
● Launcher (Home)
www.me-labs.com
Zygote Service
(Started at boot)
Zygote Dalvik VM
Process 1
Shared Memory
VM 1
Application 1 Process 2
VM 2
Application 2
Process 3
VM 3
Application 3
www.melabs.in
Application Framework
www.melabs.in
Core Platform Services
● Services that are essential to the Android platform
● Behind the scenes - applications typically donʼt
access them directly
www.melabs.in
Core Platform Services
●Activity Manager
●Package Manager
●Window Manager
●Resource Manager
●Content Providers
●View System
www.melabs.in
Hardware Services
●Telephony Service
●Location Service
●Bluetooth Service
●WiFi Service
●USB Service
●Sensor Service
Twitter : siji_sunny
Gtalk : sijisunny
siji@melabs.in
sijisunny@gmail.com
Thank You
www.melabs.in

A deep dive into Android OpenSource Project(AOSP)

  • 1.
    Mobile & EmbeddedComputing Lab An deep dive into Android Open Source Project Siji Sunny Director, MELabs siji@melabs.in Mobile : +91 9820896398 www.melabs.in
  • 2.
    www.melabs.in History ● October 2003- Android, Inc founded in California by Andy Rubin, Rich Miner, Nick Sears and Chris White. ● The company's were to develop an advanced operating system for digital cameras ● August 17, 2005 - Google acquired Android Inc. ● the team led by Rubin developed a mobile device platform powered by the Linux kernel. ● October 22, 2008 - First Android device launched in the market. Ref: Wikipedia
  • 3.
  • 4.
    ● Source codeavailable for download-Contains - Kernel - Native Libraries - Android runtime - Application Framework ● License -Android Open Source Project is the Apache Software License, Version 2.0 (For userspace). ● Android originated by a group of companies - Open Handset Alliance, led by Google. ● Freedom to implement your own device ? - Google Apps are not open-source - Vendor depended firmware/drivers Concept- AOSP Android Open-Source Project www.melabs.in
  • 5.
  • 6.
    Applications & Framework BinderIPC Linux Kernel Hardware Abstraction Layer Media Player Services Camera Service Other Services Window manager Activity Manager Notification Manager Other Services System ServerMedia Server Ref :http://s.android.com/devices/index.html www.melabs.in
  • 7.
    www.melabs.in Binder-IPC ●Driver to facilitateinter-process communication (IPC) ●Allows high level framework APIs to interact with Android's system services ●At the application framework level, all of this communication is hidden from the developer ●High performance through shared memory
  • 8.
    www.melabs.in HAL ●User space C/C++library layer ●Defines the interface that Android requires hardware “drivers” to implement ●Separates the Android platform logic from the hardware interface Graphics Audio Camera Bluetooth HARDWARE ABSTRATION LAYER
  • 9.
    www.melabs.in Native Libraries ●Bionic Libc ●FunctionLibraries (For standard calls) ●Native Servers (for UI/Video/Audios) ●Hardware Abstraction Libraries WebkitMedia Framework Sqlite Bionic Libc OpenGL|ES Audio Manager FreeType SSL LIBRARIES
  • 10.
    www.melabs.in What is Bionic ●Customlibc implementation, optimized for embedded use. Why build a custom libc library? ●License: BSD License (Objective was to keep GPL out of user-space) ●Size: will load in each process, so it needs to be small ●Fast: limited CPU power means we need to be fast ●Small size and fast code paths ●Very fast and small custom pthread implementation
  • 11.
    www.melabs.in Bionic -Disadvantage ●Doesn't supportcertain POSIX features ●Not compatible with Gnu Libc (glibc) ●All native code must be compiled against bionic
  • 12.
    www.melabs.in Dalvik Vm ● Thesoftware that runs the apps on Android devices ● It's fast, even on weak CPUs ● it will run on systems with little memory ● it will run in an energy-efficient way ● Provides application portability and runtime consistency ● Runs optimized file format (.dex) and Dalvik bytecode ● Java .class / .jar files converted to .dex at build time
  • 13.
    Compiling & packaging .javafiles source code .class file .dex file .apk file Java compiler javac Dex compiler (dx) Packaging (aapt) www.melabs.in
  • 14.
    www.melabs.in Android Runtime ● Bootloader ●Kernel ● Init ● Android runtime Dalvik/Zygote ● System Server ● Activity Manager ● Launcher (Home)
  • 15.
    www.me-labs.com Zygote Service (Started atboot) Zygote Dalvik VM Process 1 Shared Memory VM 1 Application 1 Process 2 VM 2 Application 2 Process 3 VM 3 Application 3
  • 16.
  • 17.
    www.melabs.in Core Platform Services ●Services that are essential to the Android platform ● Behind the scenes - applications typically donʼt access them directly
  • 18.
    www.melabs.in Core Platform Services ●ActivityManager ●Package Manager ●Window Manager ●Resource Manager ●Content Providers ●View System
  • 19.
    www.melabs.in Hardware Services ●Telephony Service ●LocationService ●Bluetooth Service ●WiFi Service ●USB Service ●Sensor Service
  • 20.
    Twitter : siji_sunny Gtalk: sijisunny siji@melabs.in sijisunny@gmail.com Thank You www.melabs.in