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