blob: df4fe89743b77303f03098018eaf993c91dd372d [file] [log] [blame]
Robert Ly35f2fda2013-01-29 16:27:05 -08001page.title=Overview
2@jd:body
3
4<!--
5 Copyright 2010 The Android Open Source Project
6
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
10
11 http://www.apache.org/licenses/LICENSE-2.0
12
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18-->
19<div id="qv-wrapper">
20 <div id="qv">
21 <h2>In this document</h2>
22 <ol id="auto-toc">
23 </ol>
24 </div>
25</div>
26
27<p>Welcome to the Android Platform Development Kit (PDK) Guide! The Android PDK allows partners to port
28 their drivers as well as develop, optimize, and test against an upcoming Android platform release.
29 The Android PDK includes a set of interfaces for the Android hardware abstraction layer (HAL),
30 platform sources for integration, a binary system image, and HAL and integration documentation.
31 In addition, the PDK also ships with the Android Compatibility Test Suite (CTS).
32</p>
33
34<h2 id="arch">Android Low-Level System Architecture</h2>
35<p>Before you begin porting Android to your hardware, it is important to have an
36understanding of how Android works at a high level. Because your drivers and HAL code interact
37with many layers of Android code, this understanding can help you find
38your way through the many layers of code that are available to you through the AOSP
39(Android Open Source Project) source tree as well as the PDK.
40The following diagram shows a system level view of how Android works:
41</p>
42
43<img src="images/system-architecture.png">
44
45<p class="img-caption"><strong>Figure 1.</strong> Android System Architecture</p>
46
47 <h4>Application framework</h4>
48 <p>This is the level that most application developers concern themselves with. You should be
49 aware of the APIs available to developers as many of them map 1:1 to the underlying HAL
50 interfaces and can provide information as to how to implement your driver.
51 </p>
52
53 <h4>Binder IPC</h4>
54 <p>
55 The Binder Inter-Process Communication mechanism allows the application framework to
56 cross process boundaries and call into the Android system services code. This basically allows
57 high level framework APIs to interact with Android's system services. At the application framework level, all
58 of this communication is hidden from the developer and things appear to "just work."
59 </p>
60
61 <h4>System services</h4>
62 <p>Most of the functionality exposed through the application framework APIs must
63 communicate with some sort of system service to access the underlying hardware. Services
64 are divided into modular components with focused functionality
65 such as the Window Manager, Search Service, or Notification Manager. System services are grouped
66 into two buckets: system and media. The system services include things such as the Window or
67 Notification Manager. The media services include all the services involved in playing and
68 recording media.
69 </p>
70
71<h4>Hardware abstraction layer (HAL)</h4>
72<p>The HAL serves as a standard interface that allows the Android system to call into the device
73 driver layer while being agnostic about the lower-level implementations of your drivers and hardware.
74 You must implement the corresponding HAL (and driver) for the particular piece of hardware that your product
75 provides. Android does not mandate a standard interaction between your HAL implementation and your device drivers, so
76 you have free reign to do what is best for your situation. However, you must abide by the contract
77 defined in each hardware-specific HAL interface for the Android system to be able
78 to correctly interact with your hardware. HAL implementations are typically built into
79 shared library modules (<code>.so</code> files).
80</p>
81<h4>Linux Kernel</h4>
82<p>For the most part, developing your device drivers is the same as developing a typical Linux device driver.
83 Android uses a specialized version of the Linux kernel with a few special additions such as
84 wakelocks, a memory management system that is more agressive in preserving memory,
85 the Binder IPC driver, and other features that are important for a mobile embedded platform like Android.
86 These additions have less to do with driver development than with the system's functionality. The PDK
87 does not provide kernel sources, so you must provide your own. You can use any version of the kernel that
88 you want as long as it supports the required features, such as the binder driver. However, we recommend
89 using the latest version of the Android kernel. For the latest Android kernel, see
90 <a href="{@docRoot}source/building-kernels.html" >Building Kernels</a>.
91</p>
92
93
94<h2 id="pdk">PDK Components</h2>
95<p>Now that you have a high-level overview of the Android system, we'll go over the PDK and what it provides
96 to port Android to your product. The PDK provides source files needed to implement
97 your product and a platform binary that lets you build a runnable system image. You can then install
98 this barebones image to test your product with the latest builds of Android. The most important source files
99 included in the PDK are located in the:</p>
100
101 <ul>
102 <li><code>frameworks/native</code> directory</li>
103 <li><code>frameworks/av</code> directory for media, camera, DRM, and the audio framework stack</code></li>
104 <li><code>hardware/libhardware/include/hardware</code> directory for the HAL interfaces </li>
105 <li><code>vendor/pdk/data/cts</code> directory for the CTS binaries</li>
106 </ul>
107</p>
108<p>In addition, the Android PDK includes the following source directories:</p>
109<ul>
110 <li>abi</li>
111 <li>bionic</li>
112 <li>bootable</li>
113 <li>build</li>
114 <li>device</li>
115 <li>external (Chromium and Webkit are not included)</li>
116 <li>hardware</li>
117 <li>libnativehelper</li>
118 <li>pdk</li>
119 <li>prebuilt</li>
120 <li>prebuilts</li>
121 <li>system</li>
122</ul>
123
124 <p>The PDK also contains documentation that is split into the following sections:</p>
125 <ul>
126 <li><a href="{@docRoot}devices/getting_started.html">Getting Started</a> - Explains how to download
127 the PDK source, how the Android build system works, and how to configure a build for your specific product.</li>
128 <li><a href="{@docRoot}devices/porting.html">Porting</a> - Explains the various HALs provided by Android
129 and the interfaces (C header files) that define them. This section also provides reference documentation
130 for the various HAL interfaces.</li>
131 <li><a href="{@docRoot}devices/debugtune.html">Debugging and Tuning</a> - Explains the debugging and tuning features of the PDK.</li>
132 <li><a href="{@docRoot}devices/tech/index.html">Technical Information</a> - Explains important concepts of the Android platform.</li>
133 </ul>
134
135<h3 id="cts">Compatibility Test Suite</h3>
136<p>CTS binaries for ARM, MIPS, and x86 are provided in the corresponding directories in <code>vendor/pdk/data/cts</code>. Only the ARM
137 variant is Google-verified as there is no Nexus device running on any other architecture. Not all of the CTS tests since the
138 complete Android platform is not present. The following CTS tests should work:</p>
139
140<ul>
141 <li>android.bluetooth</li>
142 <li>android.graphics</li>
143 <li>android.graphics2</li>
144 <li>android.hardware</li>
145 <li>android.location</li>
146 <li>android.opengl</li>
147 <li>android.openglperf</li>
148 <li>android.media</li>
149 <li>android.mediastress</li>
150 <li>android.nativemedia.sl</li>
151 <li>android.nativemedia.xa</li>
152 <li>android.net</li>
153 <li>android.renderscript</li>
154 </ul>
155 <p>You can run individual packages such as <code>android.media</code> with:</p>
156 <pre>cts-tradefed run singleCommand cts --skip-device-info --package android.media</pre>
157</ul>
158
159 <p>Because the PDK is missing many components compared to a full Android source tree,
160 there is a PDK test plan that is provided with CTS that limits the tests that are ran when using the PDK. You can run
161 this special test plan with the following command:</p>
162
163 <pre>run cts --plan PDK</pre>
164
165<p>CTS is always actively under development, so we expect some tests to fail. CTS results
166 for the Galaxy Nexus are provided for you in the
167 the <code>vendor/pdk/data/cts/</code> directory and will show which tests fail on that
168 device. You can safely ignore the failed tests for your devices as well.</p>
169
170 <p>See <a href="{@docRoot}compatibility/index.html">Compatibility</a> for more information on CTS.</p>
171
172<h2 id="inc-ex">PDK Inclusions and Exclusions</h2>
173<p>The PDK is a subset of the complete Android source tree and might be missing things that you might need. Here is a list of what the PDK supports
174 and does not support:</p>
175<ul>
176 <li>Supports building Android apps using the publicly available, standard SDK. Builds with non-public platform APIs are not supported. The JNI build is supported.</li>
177 <li>Supports only <code>en_US</code> locale.</li>
178 <li>Supports only phone layouts. Tablet layouts are not included.</li>
179 <li>Enables support for software navigation buttons by default, which you can disable by setting <code>qemu.jw.mainkeys=1</code>.</li>
180 <li>Builds all binaries with SMP (symmetric multiprocessing) features enabled. This might have a small performance impact on non-SMP CPUs.</li>
181 <li>Includes a minimal amount of Java libraries. Obtain any additional Java libraries from the publicly released Android source tree.</li>
182 <li>Contains a minimum number of applications. Build and install necessary applications as needed.</li>
183 <li>Does not support media streaming.</li>
184 <li>Does not include non-Latin fonts. (set by <code>MINIMAL_FONT_FOOTPRINT</code> variable in <code>BoardConfig.mk</code>).
185 An app might crash if it requires such fonts. </li>
186 <li>Does not support replacing framework resources by using the overlay mechanism.
187 This means all configurations controlled by framework resources are fixed.</li>
188 <li>Does not support NFC</li>
189 <li>Does not support DRM</li>
190</ul>
191
192<h2 id="knownissues">Support and Known Issues</h2>
193<p>
194For questions or to report issues related with the PDK, send a message to the <a href="https://groups.google.com/a/google.com/forum/?fromgroups#!forum/android-pdk-feedback">android-pdk@google.com</a> mailing list.</p>
195
196<p>The following list describes the known issues with the PDK:</p>
197<ul>
198 <li>After running the CTS (Compatibility Test Suite), <code>android.process.acore</code> crashes. This is caused by
199some missing components in PDK and does not affect the operation of CTS tests.</li>
200</p>