Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 1 | page.title=Android 2.1 Platform |
Scott Main | b149ee8 | 2009-12-15 10:47:31 -0800 | [diff] [blame] | 2 | sdk.platform.version=2.1 |
| 3 | sdk.platform.apiLevel=7 |
| 4 | sdk.platform.majorMinor=minor |
Scott Main | b149ee8 | 2009-12-15 10:47:31 -0800 | [diff] [blame] | 5 | sdk.platform.deployableDate=January 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> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 15 | <li><a href="#relnotes">Revisions</a></li> |
Dirk Dougherty | 44108b5 | 2010-05-18 16:53:06 -0700 | [diff] [blame] | 16 | <li><a href="#api-level">API Level</a></li> |
| 17 | <li><a href="#api">Framework API Changes</a> |
Scott Main | b149ee8 | 2009-12-15 10:47:31 -0800 | [diff] [blame] | 18 | <li><a href="#apps">Built-in Applications</a></li> |
| 19 | <li><a href="#locs">Locales</a></li> |
| 20 | <li><a href="#skins">Emulator Skins</a></li> |
Dirk Dougherty | 44108b5 | 2010-05-18 16:53:06 -0700 | [diff] [blame] | 21 | |
Scott Main | b149ee8 | 2009-12-15 10:47:31 -0800 | [diff] [blame] | 22 | </ol> |
| 23 | </li> |
| 24 | </ol> |
| 25 | |
Dirk Dougherty | 44108b5 | 2010-05-18 16:53:06 -0700 | [diff] [blame] | 26 | <h2>Reference</h2> |
| 27 | <ol> |
| 28 | <li><a |
| 29 | href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API |
| 30 | Differences Report »</a> </li> |
| 31 | </ol> |
| 32 | |
Scott Main | b149ee8 | 2009-12-15 10:47:31 -0800 | [diff] [blame] | 33 | <h2>See Also</h2> |
| 34 | <ol> |
| 35 | <li><a href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a></li> |
| 36 | </ol> |
| 37 | |
| 38 | </div> |
| 39 | </div> |
| 40 | |
| 41 | <p> |
Scott Main | b149ee8 | 2009-12-15 10:47:31 -0800 | [diff] [blame] | 42 | <em>API Level:</em> <strong>{@sdkPlatformApiLevel}</strong></p> |
| 43 | |
| 44 | <p>Android {@sdkPlatformVersion} is a {@sdkPlatformMajorMinor} platform release |
| 45 | deployable to Android-powered handsets starting in {@sdkPlatformDeployableDate}. |
| 46 | This release includes new API |
| 47 | changes and bug fixes. For information on changes, see the <a href="#api">Framework API</a> |
| 48 | section.</p> |
| 49 | |
| 50 | <p>For developers, the Android {@sdkPlatformVersion} platform is available as a |
| 51 | downloadable component for the Android SDK. The downloadable platform includes a |
| 52 | fully compliant Android library and system image, as well as a set of emulator |
| 53 | skins, sample applications, and more. The downloadable platform |
| 54 | includes no external libraries. </p> |
| 55 | |
| 56 | <p>To get started developing or testing against the Android |
| 57 | {@sdkPlatformVersion} platform, use the Android SDK and AVD Manager tool to |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 58 | download the platform into your SDK. For more information, |
Scott Main | b149ee8 | 2009-12-15 10:47:31 -0800 | [diff] [blame] | 59 | see <a href="{@docRoot}sdk/adding-components.html">Adding SDK |
| 60 | Components</a>.</p> |
| 61 | |
| 62 | |
| 63 | <h2 id="features">Platform Highlights</h2> |
| 64 | |
| 65 | <p>Android {@sdkPlatformVersion} does not add significant user features, see the <a |
| 66 | href="http://developer.android.com/sdk/android-2.0-highlights.html">Android |
| 67 | 2.0 Platform Highlights</a> document for the latest user features.</p> |
| 68 | |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 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 | <script type="text/javascript"> |
| 78 | function toggleDiv(link) { |
| 79 | var toggleable = $(link).parent(); |
| 80 | if (toggleable.hasClass("closed")) { |
| 81 | //$(".toggleme", toggleable).slideDown("fast"); |
| 82 | toggleable.removeClass("closed"); |
| 83 | toggleable.addClass("open"); |
| 84 | $(".toggle-img", toggleable).attr("title", "hide").attr("src", (toRoot + "assets/images/triangle-opened.png")); |
| 85 | } else { |
| 86 | //$(".toggleme", toggleable).slideUp("fast"); |
| 87 | toggleable.removeClass("open"); |
| 88 | toggleable.addClass("closed"); |
| 89 | $(".toggle-img", toggleable).attr("title", "show").attr("src", (toRoot + "assets/images/triangle-closed.png")); |
| 90 | } |
| 91 | return false; |
| 92 | } |
| 93 | </script> |
| 94 | <style> |
| 95 | .toggleable { |
Dirk Dougherty | 44108b5 | 2010-05-18 16:53:06 -0700 | [diff] [blame] | 96 | padding: .25em 1em 0em 1em; |
| 97 | margin-bottom: 0; |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 98 | } |
| 99 | .toggleme { |
| 100 | padding: 1em 1em 0 2em; |
| 101 | line-height:1em; |
| 102 | } |
| 103 | .toggleable a { |
| 104 | text-decoration:none; |
| 105 | } |
Dirk Dougherty | 0d1b081 | 2010-04-07 17:05:16 -0700 | [diff] [blame] | 106 | .toggleme a { |
| 107 | text-decoration:underline; |
| 108 | } |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 109 | .toggleable.closed .toggleme { |
| 110 | display:none; |
| 111 | } |
| 112 | #jd-content .toggle-img { |
| 113 | margin:0; |
| 114 | } |
| 115 | </style> |
| 116 | |
| 117 | <div class="toggleable opened"> |
| 118 | <a href="#" onclick="return toggleDiv(this)"> |
| 119 | <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-img" height="9px" width="9px" /> |
Dirk Dougherty | 0d1b081 | 2010-04-07 17:05:16 -0700 | [diff] [blame] | 120 | Android 2.1, Revision 2</a> <em>(May 2010)</em></a> |
| 121 | <div class="toggleme"> |
| 122 | <dl> |
| 123 | <dt>Dependencies:</dt> |
| 124 | <dd> |
| 125 | <p>Requires SDK Tools r6 or higher.</p> |
| 126 | </dd> |
| 127 | |
| 128 | <dt>Tools:</dt> |
| 129 | <dd> |
| 130 | <ul> |
| 131 | <li>Adds support for library projects in the Ant build system.</li> |
| 132 | <li>Adds improved layout rendering in ADT’s visual layout editor.</li> |
| 133 | </ul> |
| 134 | </dd> |
| 135 | |
| 136 | </dl> |
| 137 | </div> |
| 138 | </div> |
| 139 | |
| 140 | <div class="toggleable closed"> |
| 141 | <a href="#" onclick="return toggleDiv(this)"> |
Dirk Dougherty | 3c691a8 | 2010-06-15 12:27:00 -0700 | [diff] [blame^] | 142 | <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" /> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 143 | Android 2.1, Revision 1</a> <em>(January 2010)</em></a> |
| 144 | <div class="toggleme"> |
| 145 | <dl> |
| 146 | <dt>Dependencies:</dt> |
| 147 | <dd> |
| 148 | <p>Requires SDK Tools r4 or higher.</p> |
| 149 | </dd> |
| 150 | </dl> |
| 151 | </div> |
| 152 | </div> |
| 153 | |
Dirk Dougherty | 44108b5 | 2010-05-18 16:53:06 -0700 | [diff] [blame] | 154 | |
| 155 | <h2 id="api-level">API Level</h2> |
| 156 | |
| 157 | <p>The Android {@sdkPlatformVersion} platform delivers an updated version of |
| 158 | the framework API. The Android {@sdkPlatformVersion} API |
| 159 | is assigned an integer identifier — |
| 160 | <strong>{@sdkPlatformApiLevel}</strong> — that is |
| 161 | stored in the system itself. This identifier, called the "API Level", allows the |
| 162 | system to correctly determine whether an application is compatible with |
| 163 | the system, prior to installing the application. </p> |
| 164 | |
| 165 | <p>To use APIs introduced in Android {@sdkPlatformVersion} in your |
| 166 | application, you need to set the proper value, "{@sdkPlatformApiLevel}", in the |
| 167 | <code>android:minSdkVersion</code> attributes of the <code><uses-sdk></code> |
| 168 | element in your application's manifest. </p> |
| 169 | |
| 170 | <p>For more information about how to use API Level, see the <a |
| 171 | href="{@docRoot}guide/appendix/api-levels.html">API Levels</a> document. </p> |
| 172 | |
| 173 | |
| 174 | <h2 id="api">Framework API Changes</h2> |
| 175 | |
| 176 | <p>The sections below provide information about changes made to the application |
| 177 | framework API provided by the Android {@sdkPlatformVersion} platform.</p> |
| 178 | |
| 179 | <h3>Live Wallpapers</h3> |
| 180 | |
| 181 | <p>The following additions provide APIs for you to develop animated wallpapers:</p> |
| 182 | <ul> |
| 183 | <li>New {@link android.service.wallpaper} package.</li> |
| 184 | <li>New {@link android.app.WallpaperInfo} class.</li> |
| 185 | <li>Updated {@link android.app.WallpaperManager}.</li> |
| 186 | </ul> |
| 187 | |
| 188 | <p>Additionally, if your application uses or provides Live Wallpapers, you must |
| 189 | remember to add a <a |
| 190 | href="{@docRoot}guide/topics/manifest/uses-feature-element.html"><code><uses-feature></code></a> |
| 191 | element to the application's manifest, declaring the attribute |
| 192 | <code>android:name="android.software.live_wallpaper"</code>. For example:</p> |
| 193 | |
| 194 | <pre class="no-pretty-print"> |
| 195 | <uses-feature android:name="android.software.live_wallpaper" /> |
| 196 | </pre> |
| 197 | |
| 198 | <p>When you've published your application, Android Market checks for the |
| 199 | presence of this element and uses it as a filter, ensuring that your application |
| 200 | is not made available to users whose devices do not support Live Wallpapers. |
| 201 | </p> |
| 202 | |
| 203 | <h3>Telephony</h3> |
| 204 | |
| 205 | <ul> |
| 206 | <li>New {@link android.telephony.SignalStrength} class provides information |
| 207 | about the device's current network signal. This can be acquired from the |
| 208 | new {@link |
| 209 | android.telephony.PhoneStateListener#onSignalStrengthsChanged(SignalStrength)} |
| 210 | callback.</li> |
| 211 | |
| 212 | <li>New {@link |
| 213 | android.telephony.PhoneStateListener#onDataConnectionStateChanged(int,int)} |
| 214 | callback.</li> |
| 215 | </ul> |
| 216 | |
| 217 | <h3>Views</h3> |
| 218 | |
| 219 | <ul> |
| 220 | <li>New {@link android.view.View} methods {@link android.view.View#isOpaque()} |
| 221 | and {@link android.view.View#onDrawScrollBars(Canvas)}.</li> |
| 222 | |
| 223 | <li>New {@link android.widget.RemoteViews} methods {@link |
| 224 | android.widget.RemoteViews#addView(int,RemoteViews)} and {@link |
| 225 | android.widget.RemoteViews#removeAllViews(int)}.</li> |
| 226 | |
| 227 | <li>New {@link android.view.ViewGroup} methods {@link |
| 228 | android.view.ViewGroup#isChildrenDrawingOrderEnabled()} and {@link |
| 229 | android.view.ViewGroup#setChildrenDrawingOrderEnabled(boolean)}.</li> |
| 230 | </ul> |
| 231 | |
| 232 | <h3>WebKit</h3> |
| 233 | |
| 234 | <ul> |
| 235 | <li>New {@link android.webkit.WebStorage} methods to manipulate web |
| 236 | storage databases.</li> |
| 237 | |
| 238 | <li>New {@link android.webkit.GeolocationPermissions} methods to |
| 239 | get Geolocation permissions from, and set them on the WebView.</li> |
| 240 | |
| 241 | <li>New {@link android.webkit.WebSettings} methods to manage settings for |
| 242 | app cache, web storage, and zooming based on screen density.</li> |
| 243 | |
| 244 | <li>New {@link android.webkit.WebChromeClient} methods for handling video, |
| 245 | browsing history, custom Views, app cache limits, and more.</li> |
| 246 | </ul> |
| 247 | |
| 248 | </ul> |
| 249 | |
| 250 | <!-- |
| 251 | <h3 id="behavior-changes">Behavior changes</h3> |
| 252 | |
| 253 | <h3 id="bug-fixes">Bug fixes</h3> |
| 254 | --> |
| 255 | |
| 256 | <h3 id="api-diff">API differences report</h3> |
| 257 | |
| 258 | <p>For a detailed view of all API changes in Android {@sdkPlatformVersion} (API |
| 259 | Level {@sdkPlatformApiLevel}), as compared to API Level 6, see the <a |
| 260 | href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API |
| 261 | Differences Report</a>.</p> |
| 262 | |
Scott Main | b149ee8 | 2009-12-15 10:47:31 -0800 | [diff] [blame] | 263 | <h2 id="apps">Built-in Applications</h2> |
| 264 | |
| 265 | <p>The system image included in the downloadable platform provides these |
| 266 | built-in applications:</p> |
| 267 | |
| 268 | <table style="border:0;padding-bottom:0;margin-bottom:0;"> |
| 269 | <tr> |
| 270 | <td style="border:0;padding-bottom:0;margin-bottom:0;"> |
| 271 | <ul> |
| 272 | <li>Alarm Clock</li> |
| 273 | <li>Browser</li> |
| 274 | <li>Calculator</li> |
Scott Main | b149ee8 | 2009-12-15 10:47:31 -0800 | [diff] [blame] | 275 | <li>Camera</li> |
| 276 | <li>Contacts</li> |
| 277 | <li>Custom Locale (developer app)</li> |
| 278 | <li>Dev Tools (developer app)</li> |
Dirk Dougherty | 5bc32d3 | 2010-01-11 16:16:36 -0800 | [diff] [blame] | 279 | <li>Email</li> |
Scott Main | b149ee8 | 2009-12-15 10:47:31 -0800 | [diff] [blame] | 280 | </ul> |
| 281 | </td> |
| 282 | <td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;"> |
| 283 | <ul> |
Dirk Dougherty | 5bc32d3 | 2010-01-11 16:16:36 -0800 | [diff] [blame] | 284 | |
Scott Main | b149ee8 | 2009-12-15 10:47:31 -0800 | [diff] [blame] | 285 | <li>Gallery</li> |
Dirk Dougherty | 5bc32d3 | 2010-01-11 16:16:36 -0800 | [diff] [blame] | 286 | <li>IMEs for Japanese, Chinese, and Latin text input</li> |
Scott Main | b149ee8 | 2009-12-15 10:47:31 -0800 | [diff] [blame] | 287 | <li>Messaging</li> |
| 288 | <li>Music</li> |
Dirk Dougherty | 5bc32d3 | 2010-01-11 16:16:36 -0800 | [diff] [blame] | 289 | <li>Phone</li> |
Scott Main | b149ee8 | 2009-12-15 10:47:31 -0800 | [diff] [blame] | 290 | <li>Settings</li> |
| 291 | <li>Spare Parts (developer app)</li> |
| 292 | </ul> |
| 293 | </td> |
| 294 | </tr> |
| 295 | </table> |
| 296 | |
Dirk Dougherty | 5bc32d3 | 2010-01-11 16:16:36 -0800 | [diff] [blame] | 297 | |
Scott Main | b149ee8 | 2009-12-15 10:47:31 -0800 | [diff] [blame] | 298 | <h2 id="locs" style="margin-top:.75em;">Locales</h2> |
| 299 | |
| 300 | <p>The system image included in the downloadable platform provides a variety of |
| 301 | built-in locales. In some cases, region-specific strings are available for the |
| 302 | locales. In other cases, a default version of the language is used. The |
| 303 | languages that are available in the Android {@sdkPlatformVersion} system |
| 304 | image are listed below (with <em>language</em>_<em>country/region</em> locale |
| 305 | descriptor).</p> |
| 306 | |
| 307 | <table style="border:0;padding-bottom:0;margin-bottom:0;"> |
| 308 | <tr> |
| 309 | <td style="border:0;padding-bottom:0;margin-bottom:0;"> |
| 310 | <ul> |
| 311 | <li>Chinese, PRC (zh_CN)</li> |
| 312 | <li>Chinese, Taiwan (zh_TW)</li> |
| 313 | <li>Czech (cs_CZ)</li> |
| 314 | <li>Dutch, Netherlands (nl_NL)</li> |
| 315 | <li>Dutch, Belgium (nl_BE)</li> |
| 316 | <li>English, US (en_US)</li> |
| 317 | <li>English, Britain (en_GB)</li> |
| 318 | <li>English, Canada (en_CA)</li> |
| 319 | <li>English, Australia (en_AU)</li> |
| 320 | <li>English, New Zealand (en_NZ)</li> |
| 321 | <li>English, Singapore(en_SG)</li> |
| 322 | <li>French, France (fr_FR)</li> |
| 323 | <li>French, Belgium (fr_BE)</li> |
| 324 | </ul> |
| 325 | </td> |
| 326 | <td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;"> |
| 327 | <li>French, Canada (fr_CA)</li> |
| 328 | <li>French, Switzerland (fr_CH)</li> |
| 329 | <li>German, Germany (de_DE)</li> |
| 330 | <li>German, Austria (de_AT)</li> |
| 331 | <li>German, Switzerland (de_CH)</li> |
| 332 | <li>German, Liechtenstein (de_LI)</li> |
| 333 | <li>Italian, Italy (it_IT)</li> |
| 334 | <li>Italian, Switzerland (it_CH)</li> |
| 335 | <li>Japanese (ja_JP)</li> |
| 336 | <li>Korean (ko_KR)</li> |
| 337 | <li>Polish (pl_PL)</li> |
| 338 | <li>Russian (ru_RU)</li> |
| 339 | <li>Spanish (es_ES)</li> |
| 340 | </td> |
| 341 | </tr> |
| 342 | </table> |
| 343 | |
| 344 | <p>Localized UI strings match the locales that are accessible |
| 345 | through Settings.</p> |
| 346 | |
| 347 | <h2 id="skins">Emulator Skins</h2> |
| 348 | |
| 349 | <p>The downloadable platform includes a set of emulator skins that you can use |
| 350 | for modeling your application in different screen sizes and resolutions. The |
| 351 | emulator skins are:</p> |
| 352 | |
| 353 | <ul> |
| 354 | <li> |
| 355 | QVGA (240x320, low density, small screen) |
| 356 | </li> |
| 357 | <li> |
| 358 | WQVGA (240x400, low density, normal screen) |
| 359 | </li> |
| 360 | <li> |
| 361 | FWQVGA (240x432, low density, normal screen) |
| 362 | </li> |
| 363 | <li> |
| 364 | HVGA (320x480, medium density, normal screen) |
| 365 | </li> |
| 366 | <li> |
| 367 | WVGA800 (480x800, high density, normal screen) |
| 368 | </li> |
| 369 | <li> |
| 370 | WVGA854 (480x854 high density, normal screen) |
| 371 | </li> |
| 372 | </ul> |
| 373 | |
| 374 | <p>For more information about how to develop an application that displays |
| 375 | and functions properly on all Android-powered devices, see <a |
| 376 | href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple |
| 377 | Screens</a>.</p> |