• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1page.title=Android 2.3.3 APIs
2excludeFromSuggestions=true
3sdk.platform.version=2.3.3
4sdk.platform.apiLevel=10
5
6
7@jd:body
8
9<div id="qv-wrapper">
10<div id="qv">
11
12<h2>In this document</h2>
13<ol>
14  <li><a href="#api">API Overview</a></li>
15  <li><a href="#api-level">API Level</a></li>
16</ol>
17
18<h2>Reference</h2>
19<ol>
20<li><a
21href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
22Differences Report &raquo;</a> </li>
23</ol>
24
25</div>
26</div>
27
28<p>
29<em>API Level:</em>&nbsp;<strong>{@sdkPlatformApiLevel}</strong></p>
30
31<p>Android 2.3.3 ({@link android.os.Build.VERSION_CODES#GINGERBREAD_MR1})
32is a small feature release that adds several improvements
33and APIs to the Android 2.3 platform.</p>
34
35<p>For developers, the Android {@sdkPlatformVersion} platform is available as a
36downloadable component for the Android SDK. The downloadable platform includes
37an Android library and system image, as well as a set of emulator skins and
38more. To get started developing or testing against Android {@sdkPlatformVersion},
39use the Android SDK Manager to download the platform into your SDK.</p>
40
41
42
43<h2 id="api">API Overview</h2>
44
45<p>The sections below provide a technical overview of what's new for developers
46in {@sdkPlatformVersion}, including new features and changes in the framework
47API since the previous version.</p>
48
49<h3 id="nfc">Near Field Communications (NFC)</h3>
50
51<p>Android 2.3.3 provides improved and extended support for NFC, to allow
52applications to interact with more types of tags in new ways.</p>
53
54<p>A new, comprehensive set of APIs give applications read and write access
55to a wider range of standard tag technologies, including:</p>
56
57<ul>
58<li>NFC-A (ISO 14443-3A)</li>
59<li>NFC-B (ISO 14443-3B)</li>
60<li>NFC-F (JIS 6319-4)</li>
61<li>NFC-V (ISO 15693)</li>
62<li>ISO-DEP (ISO 14443-4)</li>
63<li>MIFARE Classic</li>
64<li>MIFARE Ultralight</li>
65<li>NFC Forum NDEF tags</li>
66</ul>
67
68<p>The platform also provides a limited peer-to-peer communication protocol
69and API. Foreground Activities can use the API to register an NDEF
70message that will get pushed to other NFC devices when they connect.</p>
71
72<p>Advanced tag dispatching now gives applications more control over how and
73when they are launched, when an NFC tag is discovered. Previously, the platform
74used a single-step intent dispatch to notify interested applications that a tag
75was discovered. The platform now uses a four-step process that enables the
76foreground application to take control of a tag event before it is passed to any
77other applications (<code>android.nfc.NfcAdapter.enableForegroundDispatch()</code>).
78
79The new dispatch process also lets apps listen for specific tag content and
80tag technologies, based on two new intent actions &mdash;
81<code>android.nfc.action.NDEF_DISCOVERED</code> and
82<code>android.nfc.action.TECH_DISCOVERED</code>.</p>
83
84<p>The NFC API is available in the {@link android.nfc} and
85{@link android.nfc.tech} packages. The key classes are: </p>
86
87<ul>
88<li>{@link android.nfc.NfcAdapter}, which represents the NFC hardware on the device.</li>
89<li>{@link android.nfc.NdefMessage}, which represents an NDEF data message,
90the standard format in which "records" carrying data are transmitted between
91devices and tags. An NDEF message certain many NDEF records of different types.
92Applications can receive these messages from
93{@link android.nfc.NfcAdapter#ACTION_NDEF_DISCOVERED NDEF_DISCOVERED},
94{@link android.nfc.NfcAdapter#ACTION_TECH_DISCOVERED TECH_DISCOVERED}, or
95{@link android.nfc.NfcAdapter#ACTION_TAG_DISCOVERED TAG_DISCOVERED} Intents.</li>
96<li>{@link android.nfc.NdefRecord}, delivered in an
97{@link android.nfc.NdefMessage}, which describes the type of data being shared
98and carries the data itself.</li>
99<li>{@link android.nfc.Tag}, which represents a tag scanned by the device.
100Multiple types of tags are supported, based on the underlying tag
101technology.</li>
102<li>{@link android.nfc.tech.TagTechnology}, an interface that gives applications
103access to tag properties and I/O operations based on the technologies present
104in the tag. For a full list of tag technologies supported in Android 2.3.3, see
105{@link android.nfc.tech}.</li>
106</ul>
107
108<p>NFC communication relies on wireless technology in the device hardware, and
109is not present in all Android devices. Android devices that do not support
110NFC will return a null object when
111{@link android.nfc.NfcAdapter#getDefaultAdapter(android.content.Context)
112getDefaultAdapter(Context)} is called, and
113<code>context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_NFC)</code>
114will return <code>false</code>. The NFC API is always present, however, regardless of
115underlying hardware support.</p>
116
117<p>To use the NFC API, applications must request permission from the user by
118declaring <code>&lt;uses-permission
119android:name="android.permission.NFC"&gt;</code> in their manifest files.</p>
120
121<p>Additionally, developers can request filtering on Google Play, such that
122their applications are not discoverable to users whose devices do not support
123NFC. To request filtering, add
124<code>&lt;uses-feature android:name="android.hardware.nfc"
125android:required="true"&gt;</code> to the application's manifest.</p>
126
127<p class="note">For more information, read the
128  <a href="{@docRoot}guide/topics/connectivity/nfc/index.html">NFC</a> developer guide.</p>
129
130<h3 id="bluetooth">Bluetooth</h3>
131
132<p>Android 2.3.3 adds platform and API support for Bluetooth nonsecure socket
133connections. This lets applications communicate with simple devices that may not
134offer a UI for authentication. See
135{@link android.bluetooth.BluetoothDevice#createInsecureRfcommSocketToServiceRecord(java.util.UUID)} and
136{@link android.bluetooth.BluetoothAdapter#listenUsingInsecureRfcommWithServiceRecord(java.lang.String, java.util.UUID)}
137for more information. </p>
138
139<h3 id="graphics">Graphics</h3>
140
141<ul>
142<li>A new {@link android.graphics.BitmapRegionDecoder} class lets applications
143decode a rectangle region from an image. The API is particularly useful when an
144original image is large and and the application only need parts of the image.
145</li>
146<li>A new {@link
147android.graphics.BitmapFactory.Options#inPreferQualityOverSpeed} field in {@link
148android.graphics.BitmapFactory.Options} allows applications to use a more accurate
149but slightly slower IDCT method in JPEG decode. This in turn improves the
150quality of the reconstructed image.</li>
151</ul>
152
153
154<h3 id="media">Media framework</h3>
155
156<ul>
157<li>A new {@link android.media.MediaMetadataRetriever} class provides a unified
158interface for retrieving frame and metadata from an input media file.</li>
159<li>{@link android.media.MediaRecorder.AudioEncoder} and {@link
160android.media.MediaRecorder.OutputFormat} include new fields for specifying AMR
161Wideband and AAC formats. </li>
162</ul>
163
164
165<h3 id="speech">Speech recognition</h3>
166
167<p>The speech-recognition API includes new constants to let you manage voice
168search results in new ways. Although the new constants are not needed for normal
169use of speech recognition, you could use them to offer a different view of voice
170search results in your application. For information, see {@link
171android.speech.RecognizerResultsIntent}.</p>
172
173
174<h2 id="api-level">API Level</h2>
175
176<p>The Android {@sdkPlatformVersion} platform delivers an updated version of
177the framework API. The Android {@sdkPlatformVersion} API
178is assigned an integer identifier &mdash;
179<strong>{@sdkPlatformApiLevel}</strong> &mdash; that is
180stored in the system itself. This identifier, called the "API Level", allows the
181system to correctly determine whether an application is compatible with
182the system, prior to installing the application. </p>
183
184<p>To use APIs introduced in Android {@sdkPlatformVersion} in your application,
185you need compile the application against the Android library that is provided in
186the Android {@sdkPlatformVersion} SDK platform. Depending on your needs, you might
187also need to add an <code>android:minSdkVersion="{@sdkPlatformApiLevel}"</code>
188attribute to the <code>&lt;uses-sdk&gt;</code> element in the application's
189manifest. If your application is designed to run only on Android 2.3 and higher,
190declaring the attribute prevents the application from being installed on earlier
191versions of the platform.</p>
192
193<p>For more information, read <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">What is API
194Level?</a></p>