diff options
Diffstat (limited to 'docs/html/sdk/android-2.2.jd')
-rw-r--r-- | docs/html/sdk/android-2.2.jd | 472 |
1 files changed, 472 insertions, 0 deletions
diff --git a/docs/html/sdk/android-2.2.jd b/docs/html/sdk/android-2.2.jd new file mode 100644 index 0000000..cfcb7a7 --- /dev/null +++ b/docs/html/sdk/android-2.2.jd @@ -0,0 +1,472 @@ +page.title=Android 2.2 Platform +sdk.platform.version=2.2 +sdk.platform.apiLevel=8 +sdk.platform.majorMinor=minor +sdk.platform.deployableDate=May 2010 + +@jd:body + +<div id="qv-wrapper"> +<div id="qv"> + +<h2>In this document</h2> +<ol> + <li><a href="#features">Platform Highlights</a></li> + <li><a href="#relnotes">Revisions</a></li> + <li><a href="#apps">Built-in Applications</a></li> + <li><a href="#locs">Locales</a></li> + <li><a href="#skins">Emulator Skins</a></li> + <li><a href="#api">Framework API</a> + <ol> + <li><a href="#api-level">API level</a></li> + <li><a href="#api-changes">API changes summary</a></li> + <li><a +href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API +differences report »</a> </li> + </ol> + </li> +</ol> + +<h2>See Also</h2> +<ol> + <li><a href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a></li> +</ol> + +</div> +</div> + +<p> +<em>API Level:</em> <strong>{@sdkPlatformApiLevel}</strong></p> + +<p>Android {@sdkPlatformVersion} is a {@sdkPlatformMajorMinor} platform release +deployable to Android-powered handsets starting in {@sdkPlatformDeployableDate}. +This release includes user features, developer features, API changes, and bug +fixes. For information on developer features and API changes, see the +<a href="#api">Framework API</a> section.</p> + +<p>For developers, the Android {@sdkPlatformVersion} platform is available as a +downloadable component for the Android SDK. The downloadable platform includes a +fully compliant Android library and system image, as well as a set of emulator +skins, sample applications, and more. The downloadable platform +includes no external libraries. </p> + +<p>To get started developing or testing against the Android +{@sdkPlatformVersion} platform, use the Android SDK and AVD Manager tool to +download the platform into your SDK. For more information, +see <a href="{@docRoot}sdk/adding-components.html">Adding SDK +Components</a>. If you are new to Android, <a +href="{@docRoot}sdk/index.html">download the SDK Starter Package</a> +first.</p> + + +<h2 id="features">Platform Highlights</h2> + +<p>For a list of new user features and platform highlights, see the <a +href="http://developer.android.com/sdk/android-2.2-highlights.html">Android +2.2 Platform Highlights</a> document.</p> + +<h2 id="relnotes">Revisions</h2> + +<p>The sections below provide notes about successive releases of +the Android {@sdkPlatformVersion} platform component for the Android SDK, as denoted by +revision number. To determine what revision(s) of the Android +{@sdkPlatformVersion} platforms are installed in your SDK environment, refer to +the "Installed Packages" listing in the Android SDK and AVD Manager.</p> + +<script type="text/javascript"> +function toggleDiv(link) { + var toggleable = $(link).parent(); + if (toggleable.hasClass("closed")) { + //$(".toggleme", toggleable).slideDown("fast"); + toggleable.removeClass("closed"); + toggleable.addClass("open"); + $(".toggle-img", toggleable).attr("title", "hide").attr("src", (toRoot + "assets/images/triangle-opened.png")); + } else { + //$(".toggleme", toggleable).slideUp("fast"); + toggleable.removeClass("open"); + toggleable.addClass("closed"); + $(".toggle-img", toggleable).attr("title", "show").attr("src", (toRoot + "assets/images/triangle-closed.png")); + } + return false; +} +</script> +<style> +.toggleable { +padding: .25em 1em; +} +.toggleme { + padding: 1em 1em 0 2em; + line-height:1em; +} +.toggleable a { + text-decoration:none; +} +.toggleme a { + text-decoration:underline; +} +.toggleable.closed .toggleme { + display:none; +} +#jd-content .toggle-img { + margin:0; +} +</style> + +<div class="toggleable opened"> + <a href="#" onclick="return toggleDiv(this)"> + <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-img" height="9px" width="9px" /> + Android {@sdkPlatformVersion}, Revision 1</a> <em>(May 2010)</em></a> + <div class="toggleme"> +<dl> +<dt>Dependencies:</dt> +<dd> +<p>Requires SDK Tools r6 or higher.</p> +</dd> + +<dt>Tools:</dt> +<dd> +<ul> +<li>Adds support for building with Android library projects, a capability that +lets you store shared Android application code and resources in a separate +development project. You can then reference the library project from other +Android projects and, at build time, the tools compile the shared code and +resources as part of the dependent applications. More information about this +feature is available in the <a +href="{@docRoot}guide/developing/eclipse-adt.html#libraryProject">Developing in +Eclipse, with ADT</a> and <a +href="{@docRoot}guide/developing/other-ide.html#libraryProject">Developing in +Other IDEs</a> documents. </li> +</li> +</ul> +</dd> + +</dl> + </div> +</div> + +<h2 id="apps">Built-in Applications</h2> + +<p>The system image included in the downloadable platform provides these +built-in applications:</p> + +<table style="border:0;padding-bottom:0;margin-bottom:0;"> +<tr> +<td style="border:0;padding-bottom:0;margin-bottom:0;"> + <ul> + <li>Alarm Clock</li> + <li>Browser</li> + <li>Calculator</li> + <li>Camera</li> + <li>Contacts</li> + <li>Custom Locale (developer app)</li> + <li>Dev Tools (developer app)</li> + <li>Email</li> + </ul> +</td> +<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;"> + <ul> + + <li>Gallery</li> + <li>IMEs for Japanese, Chinese, and Latin text input</li> + <li>Messaging</li> + <li>Music</li> + <li>Phone</li> + <li>Settings</li> + <li>Spare Parts (developer app)</li> + </ul> +</td> +</tr> +</table> + + +<h2 id="locs" style="margin-top:.75em;">Locales</h2> + +<p>The system image included in the downloadable platform provides a variety of +built-in locales. In some cases, region-specific strings are available for the +locales. In other cases, a default version of the language is used. The +languages that are available in the Android {@sdkPlatformVersion} system +image are listed below (with <em>language</em>_<em>country/region</em> locale +descriptor).</p> + +<table style="border:0;padding-bottom:0;margin-bottom:0;"> +<tr> +<td style="border:0;padding-bottom:0;margin-bottom:0;"> +<ul> +<li>Chinese, PRC (zh_CN)</li> +<li>Chinese, Taiwan (zh_TW)</li> +<li>Czech (cs_CZ)</li> +<li>Dutch, Netherlands (nl_NL)</li> +<li>Dutch, Belgium (nl_BE)</li> +<li>English, US (en_US)</li> +<li>English, Britain (en_GB)</li> +<li>English, Canada (en_CA)</li> +<li>English, Australia (en_AU)</li> +<li>English, New Zealand (en_NZ)</li> +<li>English, Singapore(en_SG)</li> +<li>French, France (fr_FR)</li> +<li>French, Belgium (fr_BE)</li> +</ul> +</td> +<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;"> +<li>French, Canada (fr_CA)</li> +<li>French, Switzerland (fr_CH)</li> +<li>German, Germany (de_DE)</li> +<li>German, Austria (de_AT)</li> +<li>German, Switzerland (de_CH)</li> +<li>German, Liechtenstein (de_LI)</li> +<li>Italian, Italy (it_IT)</li> +<li>Italian, Switzerland (it_CH)</li> +<li>Japanese (ja_JP)</li> +<li>Korean (ko_KR)</li> +<li>Polish (pl_PL)</li> +<li>Russian (ru_RU)</li> +<li>Spanish (es_ES)</li> +</td> +</tr> +</table> + +<p>Localized UI strings match the locales that are accessible +through Settings.</p> + +<h2 id="skins">Emulator Skins</h2> + +<p>The downloadable platform includes a set of emulator skins that you can use +for modeling your application in different screen sizes and resolutions. The +emulator skins are:</p> + +<ul> + <li> + QVGA (240x320, low density, small screen) + </li> + <li> + WQVGA (240x400, low density, normal screen) + </li> + <li> + FWQVGA (240x432, low density, normal screen) + </li> + <li> + HVGA (320x480, medium density, normal screen) + </li> + <li> + WVGA800 (480x800, high density, normal screen) + </li> + <li> + WVGA854 (480x854 high density, normal screen) + </li> +</ul> + +<p>For more information about how to develop an application that displays +and functions properly on all Android-powered devices, see <a +href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple +Screens</a>.</p> + +<h2 id="api">Framework API</h2> + +<p>The sections below provide information about changes made to the application +framework API provided by the Android {@sdkPlatformVersion} platform.</p> + + +<h3 id="api-level">API level</h3> + +<p>The Android {@sdkPlatformVersion} platform delivers an updated version of +the framework API. The Android {@sdkPlatformVersion} API +is assigned an integer identifier — +<strong>{@sdkPlatformApiLevel}</strong> — that is +stored in the system itself. This identifier, called the "API Level", allows the +system to correctly determine whether an application is compatible with +the system, prior to installing the application. </p> + +<p>To use APIs introduced in Android {@sdkPlatformVersion} in your +application, you need to set the proper value, "{@sdkPlatformApiLevel}", in the +<code>android:minSdkVersion</code> attributes of the <code><uses-sdk></code> +element in your application's manifest. </p> + +<p>For more information about how to use API Level, see the <a +href="{@docRoot}guide/appendix/api-levels.html">API Levels</a> document. </p> + + +<h3 id="api-changes">API changes summary</h3> + +<p>The sections below summarize the changes to the application framework and its APIs.</p> + +<h4 id="install-loc">App Installation on External Storage Media</h4> + +<p>The Android platform now allows applications to request installation onto the +device's external storage media (such as the SD card), as an alternative to +installation onto the device's internal memory. </p> + +<p>Application developers can express the preferred installation location for +their applications by means of a new attribute of <code><manifest></code> +in the manifest file, <a +href="{@docRoot}guide/topics/manifest/manifest-element.html#install"><code> +android:installLocation</code></a>. The attribute supports three values: +<code>"internalOnly"</code>, <code>"preferExternal"</code>, and +<code>"auto"</code>. At install time, the system checks the value of +<code>android:installLocation</code> and installs the application +<code>.apk</code> according to the preferred location, if possible. If the +application has requested external installation, the system installs it into a +private, encrypted partition in the external media. Once an application .apk is +installed externally, the system lets the user change the storage location of +the .apk and move it onto the device's internal memory if needed (and vice +versa), through Manage Applications in the user settings.</p> + +<p>By default, the system installs all applications onto the device's internal +memory, except for those that explicitly request external installation. This +means that the system will always install legacy applications onto internal +memory, since they do not have access to the +<code>android:installLocation</code> attribute. However, it is possible to +configure and compile a legacy application such that it is installed internally +on older versions of the platform and externally on Android 2.2 and later +platforms, if necessary. </p> + +<p>Note that requesting installation onto the device's external media is not +suitable for all applications, particularly because the external media may be +removable and unmounting/remounting may disrupt the user experience and system +settings.</p> + +<p>For more information about setting a preferred install location for your +application, including a discussion of what types of applications should and +should not request external installation, please read the <a +href="{@docRoot}guide/appendix/install-location.html">App Install Location</a> +document. </p> + +<h4 id="backup-manager">Backup manager</h4> + +<p>The platform now provides a generalized backup manager facility that +applications can use to backup and restore user data, to ensure that users can +maintain their data when switching devices or reinstalling the application. The +backup manager handles the work of transporting the application data to and from +the backup storage area in the cloud. The backup manager can store any type of +data, from arbitrary data to files, and manages backup and restore operations +in an atomic manner. </p> + +<p>Any application can use the backup manager to save and restore data. To do +so, the application instantiates a {@link android.app.backup.BackupManager} and +uses its methods to trigger a new backup or restore operation. The application +must also create a subclass of {@link android.app.backup.BackupAgent} and +implement its methods to handle calls from the backup manager to get data for +backup and provide data to restore +({@link android.app.backup.BackupAgent#onBackup(android.os.ParcelFileDescriptor, android.app.backup.BackupDataOutput, android.os.ParcelFileDescriptor) onBackup()} +and {@link android.app.backup.BackupAgent#onRestore(android.app.backup.BackupDataInput, int, android.os.ParcelFileDescriptor) onRestore()}). +A simple implementation of a BackupAgent useful for backing up preferences +and files is available by using {@link android.app.backup.BackupAgentHelper}. +For more information, see <a +href="{@docRoot}guide/topics/topics/data/data-backup.html">Data Backup</a>.</p> + +<h4>Graphics</h4> + +<ul> +<li>New OpenGL ES 2.0 APIs in {@link android.opengl.GLES20 android.opengl.GLES20}.</li> +<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> +<li>New {@link android.graphics.ImageFormat} class.</li> +<li>New {@link android.graphics.YuvImage YUV image format API} to enable compression from YUV to JPEG and manipulation of YUV data.</li> +</ul> + +<h4>Media</h4> + +<ul> +<li>New APIs in {@link android.media.AudioManager android.media.AudioManager} for managing audio focus, transport control, transient loss of audio focus, ducking.</li> +<li>New broadcast intent for routing audio to SCO — {@link android.media.AudioManager#ACTION_SCO_AUDIO_STATE_CHANGED} with extras indicating new state.</li> +<li>New APIs in {@link android.media.SoundPool} to detect completion of sound-loading.</li> +<li>New APIs in {@link android.media.SoundPool} for auto pause and resume.</li> +<li>New APIs in {@link android.media.MediaRecorder} for specifying audio settings for number of channels, encoding and sampling rates, sampling rate.</li> +<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> +</ul> + +<h4>Third-party voice recognition engines</h4> + +<ul> +<li>The platform now provides a {@link android.speech.RecognitionService} base class that lets third-party developers create plug-in recognition engines. </li> +<li>New {@link android.speech.RecognitionListener} interface to receive callbacks.</li> +<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> +</ul> + +<h4>Camera and camcorder</h4> + +<ul> +<li>Changes to camera preview API to improve efficieny of preview pipeline. </li> +<li>New display orientation for camera (it can now work in portrait orientation).</li> +<li>New APIs in {@link android.hardware.Camera android.hardware.Camera} for managing zoom level.</li> +<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> +<li>New {@link android.media.ThumbnailUtils thumbnail} utility for video and image thumbnails.</li> +<li>New {@link android.media.CamcorderProfile} and {@link android.media.CamcorderProfile} classes enable apps to determine device hardware camera capablities.</li> +<li>New support in {@link android.media.ExifInterface android.media.ExifInterface} for retrieving GPS and focal length.</li> +</ul> + +<h4>Device policy manager</h4> + +<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> + +<h4>UI Framework</h4> + +<ul> +<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> +<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> +<li>Improvements in the way that multitouch events are reported in {@link android.view.MotionEvent} objects.</li> +<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> +<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> +<li>Better support for managed dialogs in Activity.</li> application data (and applications) +</ul> + +<h4>Accounts and Sync</h4> + +<ul> +<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> +</ul> + +<h4>New manifest elements and attributes</h4> + +<ul> +<li>For specifying the application's preferred install location (see <a href="#install-loc">App Installation on External Storage Media</a>, above): + +<ul> + <li>New <code>android:installLocation</code> attribute of the <code><manifest></code> element. Specifies the default install location defined by an application.</li> +</ul> +</li> + +<li>For managing user data backup (see <a href="#backup-manager">Backup manager</a>, above, for more information): + +<ul> + <li> New <code>android:backupAgent</code> attribute of the +<code><application></code> element. Specifies the component name of the +BackupAgent subclass provided by the application to handle backup/restore +operations, if any.</li> + <li> New <code>android:restoreAnyVersion</code> attribute of the +<code><application></code> element. Boolean value that indicates whether +the application is prepared to attempt a restore of any backed-up dataset, even +if the backup is apparently from a newer version of the application than is +currently installed on the device.</li> +</ul> +</li> + +<li>For managing the platform's JIT compiler: + +<ul> +<li>New <code>android:vmSafeMode</code> attribute of the <code><application></code> element. Boolean value that specifies whether to disable JIT compiler optimizations when running the application.</li> +</ul> +</li> +</ul> + +<h4>Permissions</h4> + +<ul> +<li><code>android.permission.BIND_DEVICE_ADMIN</code> — Any device administration broadcast receiver must require this permission, to ensure that only the system can interact with it.</li> +<li><code>android.permission.KILL_BACKGROUND_PROCESSES</code> — Allows an application to call {@link android.app.ActivityManager#killBackgroundProcesses(String)}. +<li><code>android.permission.BIND_WALLPAPER</code> — Any {@link android.service.wallpaper.WallpaperService} must require this permission, to ensure that only the system can interact with it.</li> +<li><code>android.permission.SET_TIME</code> — Allows an application to set the system time.</li> +</ul> + +<!-- +<h3 id="behavior-changes">Behavior changes</h3> + +What did change is that android:process and android:sharedUserId can now be a reference to a resource (instead of just a literal). +<h3 id="bug-fixes">Bug fixes</h3> +--> + +<h3 id="api-diff">API differences report</h3> + +<p>For a detailed view of all API changes in Android {@sdkPlatformVersion} (API +Level {@sdkPlatformApiLevel}), see the <a +href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API +Differences Report</a>.</p> + |