blob: ed2fa72639208263fe9c900d6c06cee0a2e65b45 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<title>Dalvik Libraries</title>
<link rel=stylesheet href="dex-format.css">
<link href="prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="prettify.js"></script>
ul.code li {
font-family: monospace;
<body onload="prettyPrint()">
<h1 class="title">Dalvik Libraries</h1>
<p>The Dalvik Libraries, also known as the <i>Android core libraries</i>,
implement general purpose APIs used by code written in the Java programming
language. While the libraries themselves don't depend on Android, they do form
the foundation of the Android framework. Android applications use the Dalvik
libraries both directly and indirectly for data structures, networking,
concurrency, I/O, and more.</p>
<p>The Dalvik libraries break down into two categories:</p>
<li><a href="#vm-specific">Dalvik VM-specific libraries</a></li>
<li><a href="#interop">Java programming language interoperability
<p>Any system claiming to be Android-compatible must implement these libraries.
Unless otherwise noted, both the signatures and the behavior of such a system
need to conform to the Android 1.0 reference implementation. Both types of
conformance will be checked by the upcoming Android Compatibility Test Suite
<a name="vm-specific"/><h2>Dalvik VM-specific libraries</h2>
<p>The VM-specific libraries enable requesting or modifying VM-specific
information. Code that uses these classes is only portable across Dalvik-based
systems. The VM-specific Dalvik packages include:</p>
<ul class="code">
<a name="interop"/><h2>Java programming language interoperability libraries</h2>
<p>This category of library provides a familiar environment for programmers
writing code in the Java programming language. Much of the implementation of
this code comes from <a href="">Apache Harmony</a>.
Sometimes, we have to change the Harmony code to make it more suitable for the
memory and CPU-constrained environments targeted by Dalvik. We delineate
Dalvik-specific changes like so:
<pre class="prettyprint">
private static final long serialVersionUID = 8683452581122892189L;
// BEGIN android-added
/** zero-element array */
private static final Object[] emptyArray = new Object[0];
// END android-added
private transient int firstIndex;
<p>If you change existing Harmony code instead of just inserting new code, use
<code>android-changed</code> instead of <code>android-added</code>. These
markers help us keep track of our own changes when we pull down updates from
<p>Packages in this category include:</p>
<ul class="code">
<p>We only provide the core functionality of <code>XMLParser</code> and
<code>DocumentBuilder</code> in the XML packages. Some methods dealing with XML
schema were left out because we don't provide the corresponding packages.</p>
<p>In addition to the aforementioned packages, we plan to support the following
packages some time in the future. We currently have an unfinished
implementation of 2D drawing and image processing.</p>
<ul class="code">
<p style="margin-top: 50px">Copyright &copy; 2008 The Android Open Source