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