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