blob: ab261f0cb7be77753dab3b6269ee48a93f7b16af [file] [log] [blame]
Dirk Dougherty0d1b0812010-04-07 17:05:16 -07001page.title=Android 2.2 Platform
2sdk.platform.version=2.2
3sdk.platform.apiLevel=8
4sdk.platform.majorMinor=minor
5sdk.platform.deployableDate=May 2010
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="#features">Platform Highlights</a></li>
15 <li><a href="#relnotes">Revisions</a></li>
16 <li><a href="#apps">Built-in Applications</a></li>
17 <li><a href="#locs">Locales</a></li>
18 <li><a href="#skins">Emulator Skins</a></li>
19 <li><a href="#api">Framework API</a>
20 <ol>
21 <li><a href="#api-level">API level</a></li>
22 <li><a href="#api-changes">API changes summary</a></li>
23 <li><a
24href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
25differences report &raquo;</a> </li>
26 </ol>
27 </li>
28</ol>
29
30<h2>See Also</h2>
31<ol>
32 <li><a href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a></li>
33</ol>
34
35</div>
36</div>
37
38<p>
39<em>API Level:</em>&nbsp;<strong>{@sdkPlatformApiLevel}</strong></p>
40
Scott Main0a9cb852010-05-19 11:53:33 -070041<p>Android {@sdkPlatformVersion} is a {@sdkPlatformMajorMinor} platform release including user
42features, developer features, API changes, and bug
Dirk Dougherty0d1b0812010-04-07 17:05:16 -070043fixes. For information on developer features and API changes, see the
44<a href="#api">Framework API</a> section.</p>
45
46<p>For developers, the Android {@sdkPlatformVersion} platform is available as a
47downloadable component for the Android SDK. The downloadable platform includes a
48fully compliant Android library and system image, as well as a set of emulator
49skins, sample applications, and more. The downloadable platform
50includes no external libraries. </p>
51
52<p>To get started developing or testing against the Android
53{@sdkPlatformVersion} platform, use the Android SDK and AVD Manager tool to
54download the platform into your SDK. For more information,
55see <a href="{@docRoot}sdk/adding-components.html">Adding SDK
56Components</a>. If you are new to Android, <a
57href="{@docRoot}sdk/index.html">download the SDK Starter Package</a>
58first.</p>
59
60
61<h2 id="features">Platform Highlights</h2>
62
63<p>For a list of new user features and platform highlights, see the <a
64href="http://developer.android.com/sdk/android-2.2-highlights.html">Android
652.2 Platform Highlights</a> document.</p>
66
67<h2 id="relnotes">Revisions</h2>
68
69<p>The sections below provide notes about successive releases of
70the Android {@sdkPlatformVersion} platform component for the Android SDK, as denoted by
71revision number. To determine what revision(s) of the Android
72{@sdkPlatformVersion} platforms are installed in your SDK environment, refer to
73the "Installed Packages" listing in the Android SDK and AVD Manager.</p>
74
75<script type="text/javascript">
76function toggleDiv(link) {
77 var toggleable = $(link).parent();
78 if (toggleable.hasClass("closed")) {
79 //$(".toggleme", toggleable).slideDown("fast");
80 toggleable.removeClass("closed");
81 toggleable.addClass("open");
82 $(".toggle-img", toggleable).attr("title", "hide").attr("src", (toRoot + "assets/images/triangle-opened.png"));
83 } else {
84 //$(".toggleme", toggleable).slideUp("fast");
85 toggleable.removeClass("open");
86 toggleable.addClass("closed");
87 $(".toggle-img", toggleable).attr("title", "show").attr("src", (toRoot + "assets/images/triangle-closed.png"));
88 }
89 return false;
90}
91</script>
92<style>
93.toggleable {
94padding: .25em 1em;
95}
96.toggleme {
97 padding: 1em 1em 0 2em;
98 line-height:1em;
99}
100.toggleable a {
101 text-decoration:none;
102}
103.toggleme a {
104 text-decoration:underline;
105}
106.toggleable.closed .toggleme {
107 display:none;
108}
109#jd-content .toggle-img {
110 margin:0;
111}
112</style>
113
114<div class="toggleable opened">
115 <a href="#" onclick="return toggleDiv(this)">
116 <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-img" height="9px" width="9px" />
117 Android {@sdkPlatformVersion}, Revision 1</a> <em>(May 2010)</em></a>
118 <div class="toggleme">
119<dl>
120<dt>Dependencies:</dt>
121<dd>
122<p>Requires SDK Tools r6 or higher.</p>
123</dd>
124
125<dt>Tools:</dt>
126<dd>
Dirk Dougherty877fb9a2010-05-13 22:05:56 -0700127<p>Adds support for building with Android library projects. See <a href="tools-notes.html">SDK Tools, r6</a> for information.</p>
Dirk Dougherty0d1b0812010-04-07 17:05:16 -0700128</dd>
129
130</dl>
131 </div>
132</div>
133
134<h2 id="apps">Built-in Applications</h2>
135
136<p>The system image included in the downloadable platform provides these
137built-in applications:</p>
138
139<table style="border:0;padding-bottom:0;margin-bottom:0;">
140<tr>
141<td style="border:0;padding-bottom:0;margin-bottom:0;">
142 <ul>
143 <li>Alarm Clock</li>
144 <li>Browser</li>
145 <li>Calculator</li>
146 <li>Camera</li>
147 <li>Contacts</li>
148 <li>Custom Locale (developer app)</li>
149 <li>Dev Tools (developer app)</li>
150 <li>Email</li>
151 </ul>
152</td>
153<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
154 <ul>
155
156 <li>Gallery</li>
157 <li>IMEs for Japanese, Chinese, and Latin text input</li>
158 <li>Messaging</li>
159 <li>Music</li>
160 <li>Phone</li>
161 <li>Settings</li>
162 <li>Spare Parts (developer app)</li>
163 </ul>
164</td>
165</tr>
166</table>
167
168
169<h2 id="locs" style="margin-top:.75em;">Locales</h2>
170
171<p>The system image included in the downloadable platform provides a variety of
172built-in locales. In some cases, region-specific strings are available for the
173locales. In other cases, a default version of the language is used. The
174languages that are available in the Android {@sdkPlatformVersion} system
175image are listed below (with <em>language</em>_<em>country/region</em> locale
176descriptor).</p>
177
178<table style="border:0;padding-bottom:0;margin-bottom:0;">
179<tr>
180<td style="border:0;padding-bottom:0;margin-bottom:0;">
181<ul>
182<li>Chinese, PRC (zh_CN)</li>
183<li>Chinese, Taiwan (zh_TW)</li>
184<li>Czech (cs_CZ)</li>
185<li>Dutch, Netherlands (nl_NL)</li>
186<li>Dutch, Belgium (nl_BE)</li>
187<li>English, US (en_US)</li>
188<li>English, Britain (en_GB)</li>
189<li>English, Canada (en_CA)</li>
190<li>English, Australia (en_AU)</li>
191<li>English, New Zealand (en_NZ)</li>
192<li>English, Singapore(en_SG)</li>
193<li>French, France (fr_FR)</li>
194<li>French, Belgium (fr_BE)</li>
195</ul>
196</td>
197<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
198<li>French, Canada (fr_CA)</li>
199<li>French, Switzerland (fr_CH)</li>
200<li>German, Germany (de_DE)</li>
201<li>German, Austria (de_AT)</li>
202<li>German, Switzerland (de_CH)</li>
203<li>German, Liechtenstein (de_LI)</li>
204<li>Italian, Italy (it_IT)</li>
205<li>Italian, Switzerland (it_CH)</li>
206<li>Japanese (ja_JP)</li>
207<li>Korean (ko_KR)</li>
208<li>Polish (pl_PL)</li>
209<li>Russian (ru_RU)</li>
210<li>Spanish (es_ES)</li>
211</td>
212</tr>
213</table>
214
215<p>Localized UI strings match the locales that are accessible
216through Settings.</p>
217
218<h2 id="skins">Emulator Skins</h2>
219
220<p>The downloadable platform includes a set of emulator skins that you can use
221for modeling your application in different screen sizes and resolutions. The
222emulator skins are:</p>
223
224<ul>
225 <li>
226 QVGA (240x320, low density, small screen)
227 </li>
228 <li>
229 WQVGA (240x400, low density, normal screen)
230 </li>
231 <li>
232 FWQVGA (240x432, low density, normal screen)
233 </li>
234 <li>
235 HVGA (320x480, medium density, normal screen)
236 </li>
237 <li>
238 WVGA800 (480x800, high density, normal screen)
239 </li>
240 <li>
241 WVGA854 (480x854 high density, normal screen)
242 </li>
243</ul>
244
245<p>For more information about how to develop an application that displays
246and functions properly on all Android-powered devices, see <a
247href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
248Screens</a>.</p>
249
250<h2 id="api">Framework API</h2>
251
252<p>The sections below provide information about changes made to the application
253framework API provided by the Android {@sdkPlatformVersion} platform.</p>
254
255
256<h3 id="api-level">API level</h3>
257
258<p>The Android {@sdkPlatformVersion} platform delivers an updated version of
259the framework API. The Android {@sdkPlatformVersion} API
260is assigned an integer identifier &mdash;
261<strong>{@sdkPlatformApiLevel}</strong> &mdash; that is
262stored in the system itself. This identifier, called the "API Level", allows the
263system to correctly determine whether an application is compatible with
264the system, prior to installing the application. </p>
265
266<p>To use APIs introduced in Android {@sdkPlatformVersion} in your
267application, you need to set the proper value, "{@sdkPlatformApiLevel}", in the
268<code>android:minSdkVersion</code> attributes of the <code>&lt;uses-sdk&gt;</code>
269element in your application's manifest. </p>
270
271<p>For more information about how to use API Level, see the <a
272href="{@docRoot}guide/appendix/api-levels.html">API Levels</a> document. </p>
273
274
275<h3 id="api-changes">API changes summary</h3>
276
277<p>The sections below summarize the changes to the application framework and its APIs.</p>
278
279<h4 id="install-loc">App Installation on External Storage Media</h4>
280
281<p>The Android platform now allows applications to request installation onto the
282device's external storage media (such as the SD card), as an alternative to
283installation onto the device's internal memory. </p>
284
285<p>Application developers can express the preferred installation location for
286their applications by means of a new attribute of <code>&lt;manifest&gt;</code>
287in the manifest file, <a
288href="{@docRoot}guide/topics/manifest/manifest-element.html#install"><code>
289android:installLocation</code></a>. The attribute supports three values:
290<code>"internalOnly"</code>, <code>"preferExternal"</code>, and
291<code>"auto"</code>. At install time, the system checks the value of
292<code>android:installLocation</code> and installs the application
293<code>.apk</code> according to the preferred location, if possible. If the
294application has requested external installation, the system installs it into a
295private, encrypted partition in the external media. Once an application .apk is
296installed externally, the system lets the user change the storage location of
297the .apk and move it onto the device's internal memory if needed (and vice
298versa), through Manage Applications in the user settings.</p>
299
300<p>By default, the system installs all applications onto the device's internal
301memory, except for those that explicitly request external installation. This
302means that the system will always install legacy applications onto internal
303memory, since they do not have access to the
304<code>android:installLocation</code> attribute. However, it is possible to
305configure and compile a legacy application such that it is installed internally
306on older versions of the platform and externally on Android 2.2 and later
307platforms, if necessary. </p>
308
309<p>Note that requesting installation onto the device's external media is not
310suitable for all applications, particularly because the external media may be
311removable and unmounting/remounting may disrupt the user experience and system
312settings.</p>
313
314<p>For more information about setting a preferred install location for your
315application, including a discussion of what types of applications should and
316should not request external installation, please read the <a
317href="{@docRoot}guide/appendix/install-location.html">App Install Location</a>
318document. </p>
319
320<h4 id="backup-manager">Backup manager</h4>
321
Scott Main826c9f72010-05-14 14:17:04 -0700322<p>The platform now provides a generalized backup service that
Dirk Dougherty0d1b0812010-04-07 17:05:16 -0700323applications can use to backup and restore user data, to ensure that users can
324maintain their data when switching devices or reinstalling the application. The
Scott Main826c9f72010-05-14 14:17:04 -0700325Backup Manager handles the work of transporting the application data to and from
326the backup storage area in the cloud. The Backup Manager can store any type of
Dirk Dougherty0d1b0812010-04-07 17:05:16 -0700327data, from arbitrary data to files, and manages backup and restore operations
Scott Main826c9f72010-05-14 14:17:04 -0700328in an atomic manner. For more information, see <a
329href="{@docRoot}guide/topics/data/backup.html">Data Backup</a>.</p>
Dirk Dougherty0d1b0812010-04-07 17:05:16 -0700330
331<h4>Graphics</h4>
332
333<ul>
334<li>New OpenGL ES 2.0 APIs in {@link android.opengl.GLES20 android.opengl.GLES20}.</li>
335<li>New {@link android.opengl.ETC1}, {@link android.opengl.ETC1Util}, and {@link android.opengl.ETC1Util.ETC1Texture} classes and utility methods for using ETC1 for texture compression.</li>
336<li>New {@link android.graphics.ImageFormat} class.</li>
337<li>New {@link android.graphics.YuvImage YUV image format API} to enable compression from YUV to JPEG and manipulation of YUV data.</li>
338</ul>
339
340<h4>Media</h4>
341
342<ul>
343<li>New APIs in {@link android.media.AudioManager android.media.AudioManager} for managing audio focus, transport control, transient loss of audio focus, ducking.</li>
344<li>New broadcast intent for routing audio to SCO &mdash; {@link android.media.AudioManager#ACTION_SCO_AUDIO_STATE_CHANGED} with extras indicating new state.</li>
345<li>New APIs in {@link android.media.SoundPool} to detect completion of sound-loading.</li>
346<li>New APIs in {@link android.media.SoundPool} for auto pause and resume.</li>
347<li>New APIs in {@link android.media.MediaRecorder} for specifying audio settings for number of channels, encoding and sampling rates, sampling rate.</li>
348<li>New APIs for adding files to the media database, so that they are automatically scanned. See {@link android.media.MediaScannerConnection#scanFile(Context, String[], String[], OnScanCompletedListener) MediaScannerConnection.scanFile} and {@link android.media.MediaScannerConnection.OnScanCompletedListener MediaScannerConnection.OnScanCompletedListener}.</li>
349</ul>
350
Dirk Dougherty877fb9a2010-05-13 22:05:56 -0700351<h4>Speech recognition and third-party recognition engines</h4>
Dirk Dougherty0d1b0812010-04-07 17:05:16 -0700352
353<ul>
Dirk Dougherty877fb9a2010-05-13 22:05:56 -0700354<li>The platform provides new speech-recognition APIs that allow applications to have a richer interaction with the available voice recognizer. For example, the APIs are sufficient to integrate voice recognition deeply into an IME.</li>
355<li>The platform also provides a {@link android.speech.RecognitionService} base class that lets third-party developers create plug-in recognition engines. </li>
Dirk Dougherty0d1b0812010-04-07 17:05:16 -0700356<li>New {@link android.speech.RecognitionListener} interface to receive callbacks.</li>
357<li>New {@link android.speech.RecognizerIntent} extras that let a requester app specify details as preferred language, minimum length in milliseconds, and so on.</li>
358</ul>
359
360<h4>Camera and camcorder</h4>
361
362<ul>
363<li>Changes to camera preview API to improve efficieny of preview pipeline. </li>
364<li>New display orientation for camera (it can now work in portrait orientation).</li>
365<li>New APIs in {@link android.hardware.Camera android.hardware.Camera} for managing zoom level.</li>
366<li>New APIs {@link android.hardware.Camera.Parameters android.hardware.Camera.Parameters} for querying and setting device camera settings such as focal length, exposure, zoom level, view angle, and others.</li>
367<li>New {@link android.media.ThumbnailUtils thumbnail} utility for video and image thumbnails.</li>
368<li>New {@link android.media.CamcorderProfile} and {@link android.media.CamcorderProfile} classes enable apps to determine device hardware camera capablities.</li>
369<li>New support in {@link android.media.ExifInterface android.media.ExifInterface} for retrieving GPS and focal length.</li>
370</ul>
371
372<h4>Device policy manager</h4>
373
Dirk Dougherty877fb9a2010-05-13 22:05:56 -0700374<p>New device policy management APIs allow developers to write "device
375administrator" applications that can control security features of the device,
376such as the minimum password strength, data wipe, and so on. Users can select
377the administrators that are enabled on their devices. For more information, see
378the {@link android.app.admin android.app.admin} classees or the example
379application code in <a
380href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/DeviceAdminSample.html">DeviceAdminSample.java</a>.</p>
Dirk Dougherty0d1b0812010-04-07 17:05:16 -0700381
382<h4>UI Framework</h4>
383
384<ul>
385<li>New UI modes "car mode" and "night mode" and {@link android.app.UiModeManager} let applications adjust their application UI for specific user modes. </li>
386<li>New {@link android.view.ScaleGestureDetector} that lets Views detect and handle transformation gestures that involve more than one pointer (multitouch) using the supplied MotionEvents. </li>
387<li>Improvements in the way that multitouch events are reported in {@link android.view.MotionEvent} objects.</li>
388<li>The layout attribute <code>fill_parent</code> is renamed to <code>match_parent</code>. This affects both XML and Java code (see {@link android.view.ViewGroup.LayoutParams}). Note that the platform will continue to honor uses of <code>fill_parent</code> in legacy applications. </li>
389<li>New layout attributes {@link android.R.attr#tabStripEnabled}, {@link android.R.attr#tabStripRight}, and {@link android.R.attr#tabStripLeft} let developers customize the bottom strip of TabWidgets.</li>
Dirk Dougherty877fb9a2010-05-13 22:05:56 -0700390<li>Better support for managed dialogs in Activity.</li>
Dirk Dougherty0d1b0812010-04-07 17:05:16 -0700391</ul>
392
393<h4>Accounts and Sync</h4>
394
395<ul>
396<li>New method {@link android.content.ContentResolver#addPeriodicSync(Account, String, Bundle, long) AddPeriodicSync()} lets you schedule a periodic sync with a specific account, authority, and extras at the given frequency.</li>
397</ul>
398
399<h4>New manifest elements and attributes</h4>
400
401<ul>
402<li>For specifying the application's preferred install location (see <a href="#install-loc">App Installation on External Storage Media</a>, above):
403
404<ul>
405 <li>New <code>android:installLocation</code> attribute of the <code>&lt;manifest&gt;</code> element. Specifies the default install location defined by an application.</li>
406</ul>
407</li>
408
409<li>For managing user data backup (see <a href="#backup-manager">Backup manager</a>, above, for more information):
410
411<ul>
412 <li> New <code>android:backupAgent</code> attribute of the
413<code>&lt;application&gt;</code> element. Specifies the component name of the
414BackupAgent subclass provided by the application to handle backup/restore
415operations, if any.</li>
416 <li> New <code>android:restoreAnyVersion</code> attribute of the
417<code>&lt;application&gt;</code> element. Boolean value that indicates whether
418the application is prepared to attempt a restore of any backed-up dataset, even
419if the backup is apparently from a newer version of the application than is
420currently installed on the device.</li>
421</ul>
422</li>
423
424<li>For managing the platform's JIT compiler:
425
426<ul>
427<li>New <code>android:vmSafeMode</code> attribute of the <code>&lt;application&gt;</code> element. Boolean value that specifies whether to disable JIT compiler optimizations when running the application.</li>
428</ul>
429</li>
430</ul>
431
432<h4>Permissions</h4>
433
434<ul>
435<li><code>android.permission.BIND_DEVICE_ADMIN</code> &mdash; Any device administration broadcast receiver must require this permission, to ensure that only the system can interact with it.</li>
436<li><code>android.permission.KILL_BACKGROUND_PROCESSES</code> &mdash; Allows an application to call {@link android.app.ActivityManager#killBackgroundProcesses(String)}.
437<li><code>android.permission.BIND_WALLPAPER</code> &mdash; Any {@link android.service.wallpaper.WallpaperService} must require this permission, to ensure that only the system can interact with it.</li>
438<li><code>android.permission.SET_TIME</code> &mdash; Allows an application to set the system time.</li>
439</ul>
440
441<!--
442<h3 id="behavior-changes">Behavior changes</h3>
443
444What did change is that android:process and android:sharedUserId can now be a reference to a resource (instead of just a literal).
445<h3 id="bug-fixes">Bug fixes</h3>
446-->
447
448<h3 id="api-diff">API differences report</h3>
449
450<p>For a detailed view of all API changes in Android {@sdkPlatformVersion} (API
451Level {@sdkPlatformApiLevel}), see the <a
452href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
453Differences Report</a>.</p>
454