A2 Standard Library Subset

Android supports a relatively large subset of the Java Standard Edition 5.0 library. Some things were left out because they simply didn't make sense (such as printing), and others were omitted because better APIs are available that are specific to Android (such as user interfaces).

Supported

The following standard packages are supported in Android. Consult the Java 2 Platform Standard Edition 5.0 API documentation1 for information on how to use them:

• java.awt.font: A few constants for Unicode and fonts

• java.beans: A few classes and interfaces for JavaBeans property changes

• java.lang (except java.lang.management): Language and exception support

• java.math: Big numbers, rounding, precision

• java.security: Authorization, certificates, public keys

• java.sql: Database interfaces

• java.text: Formatting, natural language, collation

• java.util (including java.util.concurrent): Lists, maps, sets, arrays, collections

• javax.crypto: Ciphers, public keys

• javax.microedition.khronos: OpenGL graphics (from Java Micro Edition)

• javax.net: Socket factories, SSL

• javax.security (except javax.security.auth.kerberos, javax.security.auth.spi, and javax.security.sasl)

• javax.sql (except javax.sql.rowset): More database interfaces

• javax.xml.parsers: XML parsing

• org.w3c.dom (but not subpackages): DOM nodes and elements

Note that although the regular Java SQL database APIs (JDBC) are included, you don't use them to access local SQLite databases. Use the

1. http://java.sun.com/j2se/1.5.0/docs/api

android.database APIs instead (see Chapter 9, Putting SQL to Work, on page 178).

Not Supported

These packages, normally part of the Java 2 Platform Standard Edition, are not supported by Android:

• java.lang.management

• javax.accessibility

• javax.activity

• javax.imageio

• javax.management

• javax.security.auth.kerberos

• javax.security.auth.spi

• javax.security.sasl

• javax.transaction

• javax.xml (except javax.xml.parsers)

0 0

Post a comment