1. |
The Android Architecture |
|
2 hours |
|
Introduction to the Android architecture. We discuss the design and implementation of the various subsystems, at a modular "black box" level, without going into the source code level (yet).
Note: This module may be skipped for people with solid knowledge of Android Internals, who have participated in "Linux to Android"
- Android features
- Android vs. Linux vs. Embedded Linux
- Filesystem layout and directories
- The Runtime Environment
- The Frameworks
- Dalvik (Java) and ART
- Version differences - from Gingerbread to KitKat
- Security Architecture recap
- User-Mode and Kernel-Mode Architecture
|
2. |
Building Android |
|
1 hours |
|
Obtaining, navigating and compiling portions or the complete Android source
- Getting the source - repo, git, etc
- Setting up a build environment on a dedicated VM
- Considerations with cross compilation
- Getting to know Android.mk up close and personal
- Compiling and tweaking for x86, x64, or ARM
- Compiling specific Android components
Exercises include:
- Setting up an Android build environment
- Obtaining the source code of the latest Android system, compiling and building it
|
3. |
Android System Services |
|
1 day |
|
Get to know mediaserver and friends - their many threads, services and interprocess communication
- Android servers
- Debugging servers
- system_server and its multitude of threads (AudioFlinger, SurfaceFlinger, sensors..)
- servicemanager
- mediaserver
- rild
- Zygote
|
|
Detailed discussion of Android kernel changes, including:
- Ashmem
- Low memory killer
- RAM console
- Binder (as introduction - covered more in IPC
- Logging
- Power Management and wakelocks
|
|
Detailed examination the Dalvik virtual machine and its possible successor, ART, including:
- Dalvik vs. Java: Same, but different
- Architecture of Dalvik
- Memory optimizations in Dalvik
- DEX file format
- DEX bytecode format
- ART - The new runtime in KitKat
|
|
Detailed examination JNI mechanisms in Dalvik, including:
- Using JNI: From the Java and Native perspectives
- Dalvik dynamic loading of native code
- Native components in Android system services
Exercises include:
- Writing and debugging a JNI service
- Tracing server execution from Java to native code
|
6. |
The Android HAL |
|
1 hours |
|
Explaining the Android Hardware Abstraction Layer (HAL) - libhardware - as it relates to cameras, sensors, gps, and other hardware
Exercises include:
- Implementing a dummy HAL module
|
|
The heart of Android (and amongst its darkest corners) is the Binder (ported from BeOS). In this module, we elucidate its mechanisms, from it Java bindings through native code down to the underlying kernel support, including:
- libBinder
- Java's IBinder and Parcels
- The /dev/binder implementation
- Debugging Binder
- service, am, and other debugging tools
Exercises include:
- Directly starting activities and applications from native code and CLI
- Debugging Binder
|
8. |
The Android Multimedia Architecture |
|
4 hours |
|
Understand the inner workings of SurfaceFlinger, responsible for all graphics (combining views and framebuffers) in Android, AudioFlinger (sound) and Android L's InputFlinger.
- Surface/PixelFlinger
- OpenGL graphics
- Combining views
- Diagnosing the flinger
- Hardware accelearation
- AudioFlinger
- L: InputFlinger
|
|
Understand Android's Behavior as a USB target and as a USB host
- Android's USB Stack
- Android as a target
- The Gadget Driver
- Mass Storage
- PTP/MTP
- ADB
- RNDIS (Tethering)
- Android as a host and Accessory Mode
|
10. |
Android Connectivity |
|
4 hours |
|
Understand Android's various interfaces:
- Telephony (RILD)
- Wi-Fi
- Wi-Fi with wpa_supplicant
- Wi-Fi Direct with p2p_supplicant
- VPNs
- Tethering
|