• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
4<html>
5
6<head>
7
8<title>Dalvik Libraries</title>
9
10<link rel=stylesheet href="dex-format.css">
11<link href="prettify.css" type="text/css" rel="stylesheet" />
12<script type="text/javascript" src="prettify.js"></script>
13
14<style>
15ul.code li {
16  font-family: monospace;
17}
18</style>
19
20</head>
21
22<body onload="prettyPrint()">
23
24<h1 class="title">Dalvik Libraries</h1>
25
26<p>The Dalvik Libraries, also known as the <i>Android core libraries</i>,
27implement general purpose APIs used by code written in the Java programming
28language. While the libraries themselves don't depend on Android, they do form
29the foundation of the Android framework. Android applications use the Dalvik
30libraries both directly and indirectly for data structures, networking,
31concurrency, I/O, and more.</p>
32
33<p>The Dalvik libraries break down into two categories:</p>
34
35<ul>
36    <li><a href="#vm-specific">Dalvik VM-specific libraries</a></li>
37    <li><a href="#interop">Java programming language interoperability
38        libraries</a></li>
39</ul>
40
41<p>Any system claiming to be Android-compatible must implement these libraries.
42Unless otherwise noted, both the signatures and the behavior of such a system
43need to conform to the Android 1.0 reference implementation. Both types of
44conformance will be checked by the upcoming Android Compatibility Test Suite
45(CTS).</p>
46
47<a name="vm-specific"/><h2>Dalvik VM-specific libraries</h2>
48
49<p>The VM-specific libraries enable requesting or modifying VM-specific
50information. Code that uses these classes is only portable across Dalvik-based
51systems. The VM-specific Dalvik packages include:</p>
52
53<ul class="code">
54  <li>dalvik.annotation</li>
55  <li>dalvik.bytecode</li>
56  <li>dalvik.system</li>
57</ul>
58
59<a name="interop"/><h2>Java programming language interoperability libraries</h2>
60
61<p>This category of library provides a familiar environment for programmers
62writing code in the Java programming language. Much of the implementation of
63this code comes from <a href="http://harmony.apache.org/">Apache Harmony</a>.
64Sometimes, we have to change the Harmony code to make it more suitable for the
65memory and CPU-constrained environments targeted by Dalvik. We delineate
66Dalvik-specific changes like so:
67
68<pre class="prettyprint">
69    private static final long serialVersionUID = 8683452581122892189L;
70
71// BEGIN android-added
72    /** zero-element array */
73    private static final Object[] emptyArray = new Object[0];
74// END android-added
75
76    private transient int firstIndex;
77</pre>
78
79<p>If you change existing Harmony code instead of just inserting new code, use
80<code>android-changed</code> instead of <code>android-added</code>. These
81markers help us keep track of our own changes when we pull down updates from
82Harmony.</p>
83
84<p>Packages in this category include:</p>
85
86<ul class="code">
87  <li>java.io</li>
88  <li>java.lang</li>
89  <li>java.lang.annotation</li>
90  <li>java.lang.ref</li>
91  <li>java.lang.reflect</li>
92  <li>java.math</li>
93  <li>java.net</li>
94  <li>java.nio</li>
95  <li>java.nio.channels</li>
96  <li>java.nio.channels.spi</li>
97  <li>java.nio.charset</li>
98  <li>java.nio.charset.spi</li>
99  <li>java.security</li>
100  <li>java.security.acl</li>
101  <li>java.security.cert</li>
102  <li>java.security.interfaces</li>
103  <li>java.security.spec</li>
104  <li>java.sql</li>
105  <li>java.text</li>
106  <li>java.util</li>
107  <li>java.util.concurrent</li>
108  <li>java.util.concurrent.atomic</li>
109  <li>java.util.concurrent.locks</li>
110  <li>java.util.jar</li>
111  <li>java.util.logging</li>
112  <li>java.util.prefs</li>
113  <li>java.util.regex</li>
114  <li>java.util.zip</li>
115  <li>javax.crypto</li>
116  <li>javax.crypto.interfaces</li>
117  <li>javax.crypto.spec</li>
118  <li>javax.net</li>
119  <li>javax.net.ssl</li>
120  <li>javax.security.auth</li>
121  <li>javax.security.auth.callback</li>
122  <li>javax.security.auth.login</li>
123  <li>javax.security.auth.x500</li>
124  <li>javax.security.cert</li>
125  <li>javax.sql</li>
126  <li>javax.xml</li>
127  <li>javax.xml.parsers</li>
128  <li>org.w3c.dom</li>
129  <li>org.xml.sax</li>
130  <li>org.xml.sax.ext</li>
131  <li>org.xml.sax.helpers</li>
132</ul>
133
134<p>We only provide the core functionality of <code>XMLParser</code> and
135<code>DocumentBuilder</code> in the XML packages. Some methods dealing with XML
136schema were left out because we don't provide the corresponding packages.</p>
137
138<p>In addition to the aforementioned packages, we plan to support the following
139packages some time in the future. We currently have an unfinished
140implementation of 2D drawing and image processing.</p>
141
142<ul class="code">
143  <li>java.awt</li>
144  <li>java.awt.color</li>
145  <li>java.awt.event</li>
146  <li>java.awt.font</li>
147  <li>java.awt.geom</li>
148  <li>java.awt.im</li>
149  <li>java.awt.im.spi</li>
150  <li>java.awt.image</li>
151  <li>java.awt.image.renderable</li>
152  <li>javax.imageio</li>
153  <li>javax.imageio.event</li>
154  <li>javax.imageio.metadata</li>
155  <li>javax.imageio.plugins.bmp</li>
156  <li>javax.imageio.plugins.jpeg</li>
157  <li>javax.imageio.spi</li>
158  <li>javax.imageio.stream</li>
159</ul>
160
161<p style="margin-top: 50px">Copyright &copy; 2008 The Android Open Source
162Project</p>
163
164</body>
165</html>
166