Learning Embedded Android N Programming
Table of Contents
Learning Embedded Android N Programming
Credits
About the Authors
About the Reviewer
www.PacktPub.com
eBooks, discount offers, and more
Why subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Understanding the Architecture
An overview of the Android system
Linux kernel
Hardware abstraction layer – HAL
Libraries and the application framework
Libraries
The application framework
Binder IPC
The application layer
Android compatibility
The Android Compatibility Definition Document
Device types
Software compatibility
Beyond Java
Native API
Maintaining 32-bit support
From Dalvik to ART runtime
The Android runtime
A new old approach – AOT compilation
Garbage collection and other improvements
Waiting for Android Nougat
Meeting the Compatibility Test Suite
CTS setup
Device setup
Media files setup
Run!
Analyzing the test results
Diving deeper with CTS Verifier
Setup
Manual testing
Retrieving the results
Summary
2. Obtaining the Source Code – Structure and Philosophy
The Android philosophy
The license
Open source, closed doors
The Android development model
Source code tags and builds
Nexus
Phones
Tablets
Digital media players
Source code tools
Git
Repo
Gerrit
Setting up the environment
Free space
Installing the required tools
Getting ready
Downloading the code
Hands on the code
A look inside AOSP
The ART directory
The bionic directory
The build directory
The external directory
The device directory
The frameworks directory
The out directory
The packages directory
The system directory
The rest of the directory structure
Summary
3. Set up and Build – the Emulator Way
Preparing the host system
Hardware requirements
Software requirements
Installing Java JDK
Installing system dependencies
Setting up a Mac OS X environment
Creating a case-sensitive disk image
Installing the required software
The Android build system
An overview
Bootstrap
Setup
The TARGET_PRODUCT variable
The TARGET_BUILD_VARIANT variable
The TARGET_BUILD_TYPE variable
The TARGET_TOOLS_PREFIX variable
The OUT_DIR variable
The TARGET_PREBUILT_KERNEL variable
The buildspec.mk file
The lunch command
Building the system
More about make
Building a module
Cleaning a module
Cleaning everything
Listing modules
Recreating an image
Building tools
Beyond the system image
Android SDK
Android NDK
Android CTS
Inside an AOSP module
Diving into Android.mk
Android.mk variables ecosystem
The LOCAL_ variables
The BUILD_ variables
Module template examples
The native executable template
The shared library template
The application template
Creating a custom device
Diving into device configuration
From zero to the screenlock
Setup
Build
Run
Summary
4. Moving to Real-World Hardware
Debugging tools
Introducing ADB
Pushing files to devices
Pulling files from devices
Installing Android APK files
Logcat
Fastboot
Choosing our hardware
Hardware architectures
Minimum requirements
System on Chip – SoC
The baseband processor
Our hardware choice
Motorola Nexus 6
UDOO Quad
Compiling Android for a real-world device
Nexus 6
UDOO Quad
Setup
Bootloader
System
Kernel
Bootloader mode
Nexus devices
UDOO family boards
Flashing Android images
Nexus 6
UDOO
Summary
5. Customizing Kernel and Boot Sequence
An overview of the Linux kernel
Obtaining the kernel
Retrieving the kernel's binary version
Obtaining the kernel source code
Setting up the toolchain
Getting the toolchain
Preparing the host system
Configuring the kernel
Compiling the kernel
Working with non-Google devices
Driver management
Altering the CPU frequency
An overview of the governors
Customizing the boot image
Creating the boot image
Upgrading the new boot image
Android boot sequence
Internal ROM – bios
An overview of bootloader
The kernel
The Init process
The Android init language
Actions
Services
Options
Triggers
Commands
Imports
Summary
6. "Cooking" Your First ROM
History of custom ROMs
Cyanogenmod
Building Cyanogenmod
Installing a pre-build version
The Android Open Kang Project
Installing AOKP
Minor ROMs
Overview of OEM customizations
Samsung – TouchWiz
Huawei EMUI
HTC Sense
LG Optimus UI
Xiaomi MIUI
An overview of Android recovery
Diving into Android recovery
Installing an alternative recovery
Clockworkmod
TWRP – Team Win Recovery Project
Connecting to the recovery shell using ADB
Device permissions
Root access
SuperSu
Obtaining root access
Chef toolkit
Preparing the environment
Android kitchen
Other developers' tools
Manipulating DEX files with APKTool
Cooking our first ROM
Gathering the ingredients
Dumping system partitions
Modifying an Android system binary image
Modifying an Android binary boot image
Flashing our custom ROM
Summary
7. Tailoring Your Personal Android System
Receiving over the air updates – OTA
Updating the whole system
Updating the system incrementally
Applying a single component update
Creating over the air updates
OTA internals
Edify syntax
OTA f...