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