AND106 Low Level Android Programming with AIDL and NDK (4 days)
Course Outline
This course covers techniques for extending the functionality of the Android platform via the Android NDK and Android IDL APIs.
It explores techniques for accessing the underlying hardware and services available on an Android platform and also covers the building of custom platform images.
Course Objectives
The main objective of this course is to teach the theory and associated programming techniques for developing and using devices running custom hardware and system services.
Prerequisites
Attendees are expected to be experienced Android developers, with some experience of embedded application programming in C and programming using the Posix API.
Course Contents
Android - Basic Anatomy
- Linux kernel
- Native Libraries
- Android Runtime
- Application Framework
Android - Basic Physiology
- Understanding the principles of the Linux startup process
- Understanding the Android specific startup details
- Understanding the interfaces and interactions between the components and layers of an Android platform
The Android Application Framework - key concepts and components
- Activities
- Tasks
- Processes
- Threads and Loopers
- Services
- Inter-Process Communication
- An introduction and overview of AIDL
Implementing Remote Interfaces using AIDL
- Remote interface design
- Remote interface stub implementation
- Exposing remote services to local clients
JNI
- JNI overview
- Java aspects of JNI programming
- C aspects of JNI programming
- Compiling and testing of JNI application
- The advantages and disadvantages of JNI
NDK
- Mixed Java and C/C++ application development
- Android SDK and Android NDK integration
- Installing and setting up NDK
- System headers for stable native APIs
- libc (C library) headers
- libm (math library) headers
- JNI interface headers
- libz (Zlib compression) headers
- liblog (Android logging) header
- OpenGL ES 1.1 and OpenGL ES 2.0 (3D graphics libraries) headers
- Headers for C++ support
- Limitations on C++ application development
Building Android from Source
- Setting up the build tools and environment
- Obtaining the Android sources - git and repo
- Configuring and Building from the source code
Native Android Application Development in C/C++
- Working with ADB (Android Debug Bridge)
- Cross compilation - compiling C/C++ code for ARM targets
- Downloading compiled code to the Android
SDL - Simple Directmedia Layer
- Overview of SDL
- Downloading and building SDL for the Android
- Dynamic linking and loading
- SDL and building openGL ES applications
Techniques for Experimenting with Android Phones and Devices
- IPL - Initial Program Loader
- SPL - Second Program Loader
- Installing and updating SPLs
- Rooting an Android phone or embedded device
- Installing hard SPLs
- Installing custom ROM
- Radio update
- Nandroid backup, fastboot and recovery
- SD card partitioning
- Running apps from an SD card (A2SD)
- Unrooting an Android phone