Android Platform Developer's Guide 1
Android Platform Developer's Guide 5
About this Guide 5
Intended Audience 5
Getting Started with Android 5
Android Build System 6
In this document 6
Building the Android Platform 8
Building the Android Kernel 10
Build Variants 11
Configuring a New Product 12
In this document 12
Detailed Instructions 12
New Product File Tree 15
Product Definition Files 15
Build Cookbook 17
In this document 17
Building a simple APK 17
Building a APK that depends on a static .jar file 18
Building a APK that should be signed with the platform key 18
Building a APK that should be signed with a specific vendor key 19
Adding a prebuilt APK 19
Adding a Static Java Library 19
Android.mk Variables 20
Creating Release Keys and Signing Builds 29
In this document 29
Introduction 29
Generating keys 30
Signing a build for release 31
Customization 32
In this document 32
Boot Screen Customization 32
Network Customization Platform 33
Customizing pre-loaded applications 34
Customizing browser bookmarks 35
Email Provider Customization 37
Platform Themes 41
Bring Up 41
1. Confirm a Clean Installation of a Basic Linux Kernel 42
2. Modify Your Kernel Configuration to Accommodate Android Drivers 42
3. Write Drivers 42
4. Burn Images to Flash 43
5. Boot the kernel and mount the RAMdisk. 43
6. Debug Android-specific init programs on RAMdisk 44
7. Verify that applications have started 44
8. Pulling it all together 45
Android Init Language 45
Display Drivers 50
In this document 50
Functionality 51
Implementing Your Own Driver (Driver Template) 52
Troubleshooting 59
Keymaps and Keyboard Input 59
In this document 59
Functionality 60
Key Layout Map 61
Key Character Map 63
Implementing Your Own Driver (Driver Template) 67
Sample Implementation 70
Lights 70
In this document 70
Building a Lights Library 71
Interface 71
Audio 75
In this document 75
Building an Audio Library 77
Interface 77
Building a Camera Library 84
Sequence Diagrams 85
Wake Locks 90
Driver API 92
User-space API 93
Types of Wake Locks 93
Exploring a Wake Lock Example 93
PowerManager class 94
Registering Drivers with the PM Driver 94
Early Suspend 95
Sensors 95
In this document 95
Building a Sensor Library 96
Interface 97
RIL Initialization 99
RIL Interaction 99
Implementing the RIL 102
RIL Functions 103
Dalvik 105
In this document 105
Core Libraries 106
JNI Call Bridge 106
Interpreter 107
Mterp Interpreter Structure 108
Getting Started With Mterp 109
Replacing Stubs 110
Interpreter Switching 111
Testing 112
Testing and Debugging 113
Instrumentation Testing 113
In this document 113
Instrumentation Framework 114
Platform Test Suites 116
Running Tests 116
Writing Tests 120
Debugging with GDB 123
In this document 123
Debugging 124
Just-In-Time Debug Feature 126
Debugging Native Code 127
In this document 127
Capturing logs 127
Debug Scenarios 127
Debugging with tcpdump and other tools 135
Installing tcpdump 135
Running tcpdump 136
Other network debugging commands 138