# Dalvik Libraries

The Dalvik Libraries, also known as the Android core libraries, 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.

The Dalvik libraries break down into two categories:

- Dalvik VM-specific libraries
- Java programming language interoperability libraries

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 (CTS).

## Dalvik VM-specific libraries

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:

- dalvik.annotation
- dalvik.bytecode
- dalvik.system

## Java programming language interoperability libraries

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 Apache Harmony. 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:

        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;

If you change existing Harmony code instead of just inserting new code, use `android-changed` instead of `android-added`. These markers help us keep track of our own changes when we pull down updates from Harmony.

Packages in this category include:

- java.io
- java.lang
- java.lang.annotation
- java.lang.ref
- java.lang.reflect
- java.math
- java.net
- java.nio
- java.nio.channels
- java.nio.channels.spi
- java.nio.charset
- java.nio.charset.spi
- java.security
- java.security.acl
- java.security.cert
- java.security.interfaces
- java.security.spec
- java.sql
- java.text
- java.util
- java.util.concurrent
- java.util.concurrent.atomic
- java.util.concurrent.locks
- java.util.jar
- java.util.logging
- java.util.prefs
- java.util.regex
- java.util.zip
- javax.crypto
- javax.crypto.interfaces
- javax.crypto.spec
- javax.net
- javax.net.ssl
- javax.security.auth
- javax.security.auth.callback
- javax.security.auth.login
- javax.security.auth.x500
- javax.security.cert
- javax.sql
- javax.xml
- javax.xml.parsers
- org.w3c.dom
- org.xml.sax
- org.xml.sax.ext
- org.xml.sax.helpers

We only provide the core functionality of `XMLParser` and `DocumentBuilder` in the XML packages. Some methods dealing with XML schema were left out because we don't provide the corresponding packages.

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.

- java.awt
- java.awt.color
- java.awt.event
- java.awt.font
- java.awt.geom
- java.awt.im
- java.awt.im.spi
- java.awt.image
- java.awt.image.renderable
- javax.imageio
- javax.imageio.event
- javax.imageio.metadata
- javax.imageio.plugins.bmp
- javax.imageio.plugins.jpeg
- javax.imageio.spi
- javax.imageio.stream

Copyright © 2008 The Android Open Source Project