• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1page.title=<uses-sdk>
2parent.title=The AndroidManifest.xml File
3parent.link=manifest-intro.html
4@jd:body
5
6
7<div id="qv-wrapper">
8<div id="qv">
9
10<h2>In this document</h2>
11<ol>
12  <li><a href="#ApiLevels">What is API Level?</a></li>
13  <li><a href="#uses">Uses of API Level in Android</a></li>
14  <li><a href="#considerations">Development Considerations</a>
15    <ol>
16      <li><a href="#fc">Application forward compatibility</a></li>
17      <li><a href="#bc">Application backward compatibility</a></li>
18      <li><a href="#platform">Selecting a platform version and API Level</a></li>
19      <li><a href="#apilevel">Declaring a minimum API Level</a></li>
20      <li><a href="#testing">Testing against higher API Levels</a></li>
21    </ol>
22  </li>
23  <li><a href="#provisional">Using a Provisional API Level</a></li>
24  <li><a href="#filtering">Filtering the Reference Documentation by API Level</a></li>
25</ol>
26</div>
27</div>
28
29<dl class="xml">
30<dt>syntax:</dt>
31<dd><pre>
32&lt;uses-sdk android:<a href="#min">minSdkVersion</a>="<i>integer</i>"
33          android:<a href="#target">targetSdkVersion</a>="<i>integer</i>"
34          android:<a href="#max">maxSdkVersion</a>="<i>integer</i>" /&gt;</pre></dd>
35
36<dt>contained in:</dt>
37<dd><code><a href="{@docRoot}guide/topics/manifest/manifest-element.html">&lt;manifest&gt;</a></code></dd>
38
39<dt>description:</dt>
40<dd>Lets you express an application's compatibility with one or more versions of the Android platform,
41by means of an API Level integer. The API Level expressed by an application will be compared to the
42API Level of a given Android system, which may vary among different Android devices.
43</p>
44
45<p>Despite its name, this element is used to specify the API Level, <em>not</em>
46the version number of the SDK (software development kit) or Android platform.
47The API Level is always a single integer. You cannot derive the API Level from
48its associated Android version number (for example, it is not the same as the
49major version or the sum of the major and minor versions).</p>
50
51<p>Also read the document about
52<a href="{@docRoot}tools/publishing/versioning.html">Versioning Your Applications</a>.
53</p></dd>
54
55 <div class="sidebox-wrapper" xstyle="margin-bottom:2em;margin-top:.5em;width:90%;">
56  <img id="rule" src="{@docRoot}assets/images/grad-rule-qv.png">
57  <div id="qv-sub-rule">
58    <img src="{@docRoot}assets/images/icon_play.png" style="float:left;margin:0;padding:0;">
59    <p style="color:#669999;padding-top:1em;">Google Play and &lt;uses-sdk&gt; attributes</p>
60    <p style="padding-top:1em;">Google Play filters the applications that are visible to users, so
61that users can only see and download applications that are compatible with their
62devices. One of the ways it filters applications is by Android
63version-compatibility. To do this, Google Play checks the <code>&lt;uses-sdk&gt;</code>
64attributes in each application's manifest to establish its version-compatibility
65range, then shows or hides the application based on a comparison with the API
66Level of the user's Android system version. For more information, see <a
67href="{@docRoot}guide/google/play/filters.html">Filters on Google Play</a>.</p>
68  </div>
69</div>
70
71<dt>attributes:</dt>
72
73<dd>
74<dl class="attr">
75  <dt><a name="min"></a>{@code android:minSdkVersion}</dt>
76  <dd>An integer designating the minimum API Level required
77  for the application to run. The Android system will prevent the user from installing
78  the application if the system's API Level is lower than the value specified in
79  this attribute. You should always declare this attribute.
80
81  <p class="caution"><strong>Caution:</strong> If you do not declare this
82  attribute, the system assumes a default value of "1", which indicates that your
83  application is compatible with all versions of Android. If your application is
84  <em>not</em> compatible with all versions (for instance, it uses APIs introduced
85  in API Level 3) and you have not declared the proper <code>minSdkVersion</code>,
86  then when installed on a system with an API Level less than 3, the application
87  will crash during runtime when attempting to access the unavailable APIs. For
88  this reason, be certain to declare the appropriate API Level in the
89  <code>minSdkVersion</code> attribute.</p>
90  </dd>
91
92  <dt><a name="target"></a>{@code android:targetSdkVersion}</dt>
93  <dd>An integer designating the API Level that the application targets. If not set, the default
94value equals that given to {@code minSdkVersion}.
95
96  <p>This attribute informs the system that you have tested against the target version and the
97system should not enable any compatibility behaviors to maintain your app's forward-compatibility
98with the target version. The application is still able to run on older versions (down to {@code
99minSdkVersion}).</p>
100
101  <p>As Android evolves with each new version, some behaviors and even appearances might change.
102However, if the API level of the platform is higher than the version declared by your app's {@code
103targetSdkVersion}, the system may enable compatibility behaviors to ensure that your app
104continues to work the way you expect. You can disable such compatibility
105behaviors by specifying {@code targetSdkVersion} to match the API
106level of the platform on which it's running. For example, setting this value to "11" or higher
107allows the system to apply a new default theme (Holo) to your app when running on Android 3.0 or
108higher and also disables <a href="{@docRoot}guide/practices/screen-compat-mode.html">screen
109compatibility mode</a> when running on larger screens (because support for API level 11 implicitly
110supports larger screens).</p>
111
112  <p>There are many compatibility behaviors that the system may enable based on the value you set
113for this attribute. Several of these behaviors are described by the corresponding platform versions
114in the {@link android.os.Build.VERSION_CODES} reference.</p>
115
116  <p>To maintain your application along with each Android release, you should increase
117the value of this attribute to match the latest API level, then thoroughly test your application on
118the corresponding platform version.</p>
119
120  <p>Introduced in: API Level 4</p>
121  </dd>
122
123  <dt><a name="max"></a>{@code android:maxSdkVersion}</dt>
124  <dd>An integer designating the maximum API Level on which the application is
125  designed to run.
126
127  <p>In Android 1.5, 1.6, 2.0, and 2.0.1, the system checks the value of this
128  attribute when installing an application and when re-validating the application
129  after a system update. In either case, if the application's
130  <code>maxSdkVersion</code> attribute is lower than the API Level used by
131  the system itself, then the system will not allow the application to be
132  installed. In the case of re-validation after system update, this effectively
133  removes your application from the device.
134
135  <p>To illustrate how this attribute can affect your application after system
136  updates, consider the following example: </p>
137
138  <p>An application declaring <code>maxSdkVersion="5"</code> in its
139  manifest is published on Google Play. A user whose device is running Android
140  1.6 (API Level 4) downloads and installs the app. After a few weeks, the user
141  receives an over-the-air system update to Android 2.0 (API Level 5). After the
142  update is installed, the system checks the application's
143  <code>maxSdkVersion</code> and successfully re-validates it. The
144  application functions as normal. However, some time later, the device receives
145  another system update, this time to Android 2.0.1 (API Level 6). After the
146  update, the system can no longer re-validate the application because the system's
147  own API Level (6) is now higher than the maximum supported by the application
148  (5). The system prevents the application from being visible to the user, in
149  effect removing it from the device.</p>
150
151  <p class="warning"><strong>Warning:</strong> Declaring this attribute is not
152  recommended. First, there is no need to set the attribute as means of blocking
153  deployment of your application onto new versions of the Android platform as they
154  are released. By design, new versions of the platform are fully
155  backward-compatible. Your application should work properly on new versions,
156  provided it uses only standard APIs and follows development best practices.
157  Second, note that in some cases, declaring the attribute can <strong>result in
158  your application being removed from users' devices after a system
159  update</strong> to a higher API Level. Most devices on which your application
160  is likely to be installed will receive periodic system updates over the air, so
161  you should consider their effect on your application before setting this
162  attribute.</p>
163
164  <p style="margin-bottom:1em;">Introduced in: API Level 4</p>
165
166  <div class="special">Future versions of Android (beyond Android 2.0.1) will no
167longer check or enforce the <code>maxSdkVersion</code> attribute during
168installation or re-validation. Google Play will continue to use the attribute
169as a filter, however, when presenting users with applications available for
170download. </div>
171  </dd>
172
173
174</dl></dd>
175
176<!-- ##api level indication## -->
177<dt>introduced in:</dt>
178<dd>API Level 1</dd>
179
180</dl>
181
182
183
184
185
186<!--- CONTENT FROM OLD API LEVEL DOC ---->
187
188
189
190
191<h2 id="ApiLevels">What is API Level?</h2>
192
193<p>API Level is an integer value that uniquely identifies the framework API
194revision offered by a version of the Android platform.</p>
195
196<p>The Android platform provides a framework API that applications can use to
197interact with the underlying Android system. The framework API consists of:</p>
198
199<ul>
200<li>A core set of packages and classes</li>
201<li>A set of XML elements and attributes for declaring a manifest file</li>
202<li>A set of XML elements and attributes for declaring and accessing resources</li>
203<li>A set of Intents</li>
204<li>A set of permissions that applications can request, as well as permission
205enforcements included in the system</li>
206</ul>
207
208<p>Each successive version of the Android platform can include updates to the
209Android application framework API that it delivers. </p>
210
211<p>Updates to the framework API are designed so that the new API remains
212compatible with earlier versions of the API. That is, most changes in the API
213are additive and introduce new or replacement functionality. As parts of the API
214are upgraded, the older replaced parts are deprecated but are not removed, so
215that existing applications can still use them. In a very small number of cases,
216parts of the API may be modified or removed, although typically such changes are
217only needed to ensure API robustness and application or system security. All
218other API parts from earlier revisions are carried forward without
219modification.</p>
220
221<p>The framework API that an Android platform delivers is specified using an
222integer identifier called "API Level". Each Android platform version supports
223exactly one API Level, although support is implicit for all earlier API Levels
224(down to API Level 1). The initial release of the Android platform provided
225API Level 1 and subsequent releases have incremented the API Level.</p>
226
227<p>The following table specifies the API Level supported by each version of the
228Android platform.</p>
229
230<table>
231  <tr><th>Platform Version</th><th>API Level</th><th>VERSION_CODE</th><th>Notes</th></tr>
232
233     <tr><td><a href="{@docRoot}about/versions/android-4.0.3.html">Android 4.0.3</a></td>
234    <td><a href="{@docRoot}sdk/api_diff/15/changes.html" title="Diff Report">15</a></td>
235    <td>{@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH_MR1}</td>
236    <td rowspan="2"><a href="{@docRoot}about/versions/android-4.0-highlights.html">Platform
237Highlights</a></td></tr>
238
239    <tr><td><a href="{@docRoot}about/versions/android-4.0.html">Android 4.0, 4.0.1, 4.0.2</a></td>
240    <td><a href="{@docRoot}sdk/api_diff/14/changes.html" title="Diff Report">14</a></td>
241    <td>{@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH}</td>
242    </tr>
243
244    <tr><td><a href="{@docRoot}about/versions/android-3.2.html">Android 3.2</a></td>
245    <td><a href="{@docRoot}sdk/api_diff/13/changes.html" title="Diff Report">13</a></td>
246    <td>{@link android.os.Build.VERSION_CODES#HONEYCOMB_MR2}</td>
247    <td><!-- <a href="{@docRoot}about/versions/android-3.2-highlights.html">Platform
248Highlights</a>--></td></tr>
249
250  <tr><td><a href="{@docRoot}about/versions/android-3.1.html">Android 3.1.x</a></td>
251    <td><a href="{@docRoot}sdk/api_diff/12/changes.html" title="Diff Report">12</a></td>
252    <td>{@link android.os.Build.VERSION_CODES#HONEYCOMB_MR1}</td>
253    <td><a href="{@docRoot}about/versions/android-3.1-highlights.html">Platform Highlights</a></td></tr>
254
255  <tr><td><a href="{@docRoot}about/versions/android-3.0.html">Android 3.0.x</td>
256    <td><a href="{@docRoot}sdk/api_diff/11/changes.html" title="Diff Report">11</a></td>
257    <td>{@link android.os.Build.VERSION_CODES#HONEYCOMB}</td>
258    <td><a href="{@docRoot}about/versions/android-3.0-highlights.html">Platform Highlights</a></td></tr>
259
260  <tr><td><a href="{@docRoot}about/versions/android-2.3.3.html">Android 2.3.4<br>Android 2.3.3</td>
261    <td><a href="{@docRoot}sdk/api_diff/10/changes.html" title="Diff Report">10</a></td>
262    <td>{@link android.os.Build.VERSION_CODES#GINGERBREAD_MR1}</td>
263    <td rowspan="2"><a href="{@docRoot}about/versions/android-2.3-highlights.html">Platform
264Highlights</a></td></tr>
265
266  <tr><td><a href="{@docRoot}about/versions/android-2.3.html">Android 2.3.2<br>Android 2.3.1<br>Android
2672.3</td>
268    <td><a href="{@docRoot}sdk/api_diff/9/changes.html" title="Diff Report">9</a></td>
269    <td>{@link android.os.Build.VERSION_CODES#GINGERBREAD}</td>
270    </tr>
271
272  <tr><td><a href="{@docRoot}about/versions/android-2.2.html">Android 2.2.x</td>
273    <td ><a href="{@docRoot}sdk/api_diff/8/changes.html" title="Diff Report">8</a></td>
274    <td>{@link android.os.Build.VERSION_CODES#FROYO}</td>
275    <td><a href="{@docRoot}about/versions/android-2.2-highlights.html">Platform Highlights</a></td></tr>
276
277  <tr><td><a href="{@docRoot}about/versions/android-2.1.html">Android 2.1.x</td>
278    <td><a href="{@docRoot}sdk/api_diff/7/changes.html" title="Diff Report">7</a></td>
279    <td>{@link android.os.Build.VERSION_CODES#ECLAIR_MR1}</td>
280    <td rowspan="3" ><a href="{@docRoot}about/versions/android-2.0-highlights.html">Platform
281Highlights</a></td></tr>
282
283  <tr><td><a href="{@docRoot}about/versions/android-2.0.1.html">Android 2.0.1</td>
284    <td><a href="{@docRoot}sdk/api_diff/6/changes.html" title="Diff Report">6</a></td>
285    <td>{@link android.os.Build.VERSION_CODES#ECLAIR_0_1}</td>
286    </tr>
287
288  <tr><td><a href="{@docRoot}about/versions/android-2.0.html">Android 2.0</td>
289    <td><a href="{@docRoot}sdk/api_diff/5/changes.html" title="Diff Report">5</a></td>
290    <td>{@link android.os.Build.VERSION_CODES#ECLAIR}</td>
291    </tr>
292
293  <tr><td><a href="{@docRoot}about/versions/android-1.6.html">Android 1.6</td>
294    <td><a href="{@docRoot}sdk/api_diff/4/changes.html" title="Diff Report">4</a></td>
295    <td>{@link android.os.Build.VERSION_CODES#DONUT}</td>
296    <td><a href="{@docRoot}about/versions/android-1.6-highlights.html">Platform Highlights</a></td></tr>
297
298  <tr><td><a href="{@docRoot}about/versions/android-1.5.html">Android 1.5</td>
299    <td><a href="{@docRoot}sdk/api_diff/3/changes.html" title="Diff Report">3</a></td>
300    <td>{@link android.os.Build.VERSION_CODES#CUPCAKE}</td>
301    <td><a href="{@docRoot}about/versions/android-1.5-highlights.html">Platform Highlights</a></td></tr>
302
303  <tr><td><a href="{@docRoot}about/versions/android-1.1.html">Android 1.1</td>
304    <td>2</td>
305    <td>{@link android.os.Build.VERSION_CODES#BASE_1_1}</td><td></td></tr>
306
307  <tr><td>Android 1.0</td>
308    <td>1</td>
309    <td>{@link android.os.Build.VERSION_CODES#BASE}</td>
310    <td></td></tr>
311</table>
312
313
314<h2 id="uses">Uses of API Level in Android</h2>
315
316<p>The API Level identifier serves a key role in ensuring the best possible
317experience for users and application developers:
318
319<ul>
320<li>It lets the Android platform describe the maximum framework API revision
321that it supports</li>
322<li>It lets applications describe the framework API revision that they
323require</li>
324<li>It lets the system negotiate the installation of applications on the user's
325device, such that version-incompatible applications are not installed.</li>
326</ul>
327
328<p>Each Android platform version stores its API Level identifier internally, in
329the Android system itself. </p>
330
331<p>Applications can use a manifest element provided by the framework API &mdash;
332<code>&lt;uses-sdk&gt;</code> &mdash; to describe the minimum and maximum API
333Levels under which they are able to run, as well as the preferred API Level that
334they are designed to support. The element offers three key attributes:</p>
335
336<ul>
337<li><code>android:minSdkVersion</code> &mdash; Specifies the minimum API Level
338on which the application is able to run. The default value is "1".</li>
339<li><code>android:targetSdkVersion</code> &mdash; Specifies the API Level
340on which the application is designed to run. In some cases, this allows the
341application to use manifest elements or behaviors defined in the target
342API Level, rather than being restricted to using only those defined
343for the minimum API Level.</li>
344<li><code>android:maxSdkVersion</code> &mdash; Specifies the maximum API Level
345on which the application is able to run. <strong>Important:</strong> Please read the <a
346href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code>&lt;uses-sdk&gt;</code></a>
347documentation before using this attribute.  </li>
348</ul>
349
350<p>For example, to specify the minimum system API Level that an application
351requires in order to run, the application would include in its manifest a
352<code>&lt;uses-sdk&gt;</code> element with a <code>android:minSdkVersion</code>
353attribute. The value of <code>android:minSdkVersion</code> would be the integer
354corresponding to the API Level of the earliest version of the Android platform
355under which the application can run. </p>
356
357<p>When the user attempts to install an application, or when revalidating an
358appplication after a system update, the Android system first checks the
359<code>&lt;uses-sdk&gt;</code> attributes in the application's manifest and
360compares the values against its own internal API Level. The system allows the
361installation to begin only if these conditions are met:</p>
362
363<ul>
364<li>If a <code>android:minSdkVersion</code> attribute is declared, its value
365must be less than or equal to the system's API Level integer. If not declared,
366the system assumes that the application requires API Level 1. </li>
367<li>If a <code>android:maxSdkVersion</code> attribute is declared, its value
368must be equal to or greater than the system's API Level integer.
369If not declared, the system assumes that the application
370has no maximum API Level. Please read the <a
371href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code>&lt;uses-sdk&gt;</code></a>
372documentation for more information about how the system handles this attribute.</li>
373</ul>
374
375<p>When declared in an application's manifest, a <code>&lt;uses-sdk&gt;</code>
376element might look like this: </p>
377
378<pre>&lt;manifest&gt;
379  &lt;uses-sdk android:minSdkVersion="5" /&gt;
380  ...
381&lt;/manifest&gt;</pre>
382
383<p>The principal reason that an application would declare an API Level in
384<code>android:minSdkVersion</code> is to tell the Android system that it is
385using APIs that were <em>introduced</em> in the API Level specified. If the
386application were to be somehow installed on a platform with a lower API Level,
387then it would crash at run-time when it tried to access APIs that don't exist.
388The system prevents such an outcome by not allowing the application to be
389installed if the lowest API Level it requires is higher than that of the
390platform version on the target device.</p>
391
392<p>For example, the {@link android.appwidget} package was introduced with API
393Level 3. If an application uses that API, it must declare a
394<code>android:minSdkVersion</code> attribute with a value of "3". The
395application will then be installable on platforms such as Android 1.5 (API Level
3963) and Android 1.6 (API Level 4), but not on the Android 1.1 (API Level 2) and
397Android 1.0 platforms (API Level 1).</p>
398
399<p>For more information about how to specify an application's API Level
400requirements, see the <a
401href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code>&lt;uses-sdk&gt;</code></a>
402 section of the manifest file documentation.</p>
403
404
405<h2 id="considerations">Development Considerations</h2>
406
407<p>The sections below provide information related to API level that you should
408consider when developing your application.</p>
409
410<h3 id="fc">Application forward compatibility</h3>
411
412<p>Android applications are generally forward-compatible with new versions of
413the Android platform.</p>
414
415<p>Because almost all changes to the framework API are additive, an Android
416application developed using any given version of the API (as specified by its
417API Level) is forward-compatible with later versions of the Android platform and
418higher API levels. The application should be able to run on all later versions
419of the Android platform, except in isolated cases where the application uses a
420part of the API that is later removed for some reason. </p>
421
422<p>Forward compatibility is important because many Android-powered devices
423receive over-the-air (OTA) system updates. The user may install your
424application and use it successfully, then later receive an OTA update to a new
425version of the Android platform. Once the update is installed, your application
426will run in a new run-time version of the environment, but one that has the API
427and system capabilities that your application depends on. </p>
428
429<p>In some cases, changes <em>below</em> the API, such those in the underlying
430system itself, may affect your application when it is run in the new
431environment. For that reason it's important for you, as the application
432developer, to understand how the application will look and behave in each system
433environment. To help you test your application on various versions of the Android
434platform, the Android SDK includes multiple platforms that you can download.
435Each platform includes a compatible system image that you can run in an AVD, to
436test your application. </p>
437
438<h3 id="bc">Application backward compatibility</h3>
439
440<p>Android applications are not necessarily backward compatible with versions of
441the Android platform older than the version against which they were compiled.
442</p>
443
444<p>Each new version of the Android platform can include new framework APIs, such
445as those that give applications access to new platform capabilities or replace
446existing API parts. The new APIs are accessible to applications when running on
447the new platform and, as mentioned above, also when running on later versions of
448the platform, as specified by API Level. Conversely, because earlier versions of
449the platform do not include the new APIs, applications that use the new APIs are
450unable to run on those platforms.</p>
451
452<p>Although it's unlikely that an Android-powered device would be downgraded to
453a previous version of the platform, it's important to realize that there are
454likely to be many devices in the field that run earlier versions of the
455platform. Even among devices that receive OTA updates, some might lag and
456might not receive an update for a significant amount of time. </p>
457
458<h3 id="platform">Selecting a platform version and API Level</h3>
459
460<p>When you are developing your application, you will need to choose
461the platform version against which you will compile the application. In
462general, you should compile your application against the lowest possible
463version of the platform that your application can support.
464
465<p>You can determine the lowest possible platform version by compiling the
466application against successively lower build targets. After you determine the
467lowest version, you should create an AVD using the corresponding platform
468version (and API Level) and fully test your application. Make sure to declare a
469<code>android:minSdkVersion</code> attribute in the application's manifest and
470set its value to the API Level of the platform version. </p>
471
472<h3 id="apilevel">Declaring a minimum API Level</h3>
473
474<p>If you build an application that uses APIs or system features introduced in
475the latest platform version, you should set the
476<code>android:minSdkVersion</code> attribute to the API Level of the latest
477platform version. This ensures that users will only be able to install your
478application if their devices are running a compatible version of the Android
479platform. In turn, this ensures that your application can function properly on
480their devices. </p>
481
482<p>If your application uses APIs introduced in the latest platform version but
483does <em>not</em> declare a <code>android:minSdkVersion</code> attribute, then
484it will run properly on devices running the latest version of the platform, but
485<em>not</em> on devices running earlier versions of the platform. In the latter
486case, the application will crash at runtime when it tries to use APIs that don't
487exist on the earlier versions.</p>
488
489<h3 id="testing">Testing against higher API Levels</h3>
490
491<p>After compiling your application, you should make sure to test it on the
492platform specified in the application's <code>android:minSdkVersion</code>
493attribute. To do so, create an AVD that uses the platform version required by
494your application. Additionally, to ensure forward-compatibility, you should run
495and test the application on all platforms that use a higher API Level than that
496used by your application. </p>
497
498<p>The Android SDK includes multiple platform versions that you can use,
499including the latest version, and provides an updater tool that you can use to
500download other platform versions as necessary. </p>
501
502<p>To access the updater, use the <code>android</code> command-line tool,
503located in the &lt;sdk&gt;/tools directory. You can launch the SDK updater by
504executing <code>android sdk</code>. You can
505also simply double-click the android.bat (Windows) or android (OS X/Linux) file.
506In ADT, you can also access the updater by selecting
507<strong>Window</strong>&nbsp;>&nbsp;<strong>Android SDK
508Manager</strong>.</p>
509
510<p>To run your application against different platform versions in the emulator,
511create an AVD for each platform version that you want to test. For more
512information about AVDs, see <a
513href="{@docRoot}tools/devices/index.html">Creating and Managing Virtual Devices</a>. If
514you are using a physical device for testing, ensure that you know the API Level
515of the Android platform it runs. See the table at the top of this document for
516a list of platform versions and their API Levels. </p>
517
518<h2 id="provisional">Using a Provisional API Level</h2>
519
520<p>In some cases, an "Early Look" Android SDK platform may be available. To let
521you begin developing on the platform although the APIs may not be final, the
522platform's API Level integer will not be specified. You must instead use the
523platform's <em>provisional API Level</em> in your application manifest, in order
524to build applications against the platform. A provisional API Level is not an
525integer, but a string matching the codename of the unreleased platform version.
526The provisional API Level will be specified in the release notes for the Early
527Look SDK release notes and is case-sensitive.</p>
528
529<p>The use of a provisional API Level is designed to protect developers and
530device users from inadvertently publishing or installing applications based on
531the Early Look framework API, which may not run properly on actual devices
532running the final system image.</p>
533
534<p>The provisional API Level will only be valid while using the Early Look SDK
535and can only be used to run applications in the emulator. An application using
536the provisional API Level can never be installed on an Android device. At the
537final release of the platform, you must replace any instances of the provisional
538API Level in your application manifest with the final platform's actual API
539Level integer.</p>
540
541
542<h2 id="filtering">Filtering the Reference Documentation by API Level</h2>
543
544<p>Reference documentation pages on the Android Developers site offer a "Filter
545by API Level" control in the top-right area of each page. You can use the
546control to show documentation only for parts of the API that are actually
547accessible to your application, based on the API Level that it specifies in
548the <code>android:minSdkVersion</code> attribute of its manifest file. </p>
549
550<p>To use filtering, select the checkbox to enable filtering, just below the
551page search box. Then set the "Filter by API Level" control to the same API
552Level as specified by your application. Notice that APIs introduced in a later
553API Level are then grayed out and their content is masked, since they would not
554be accessible to your application. </p>
555
556<p>Filtering by API Level in the documentation does not provide a view
557of what is new or introduced in each API Level &mdash; it simply provides a way
558to view the entire API associated with a given API Level, while excluding API
559elements introduced in later API Levels.</p>
560
561<p>If you decide that you don't want to filter the API documentation, just
562disable the feature using the checkbox. By default, API Level filtering is
563disabled, so that you can view the full framework API, regardless of API Level.
564</p>
565
566<p>Also note that the reference documentation for individual API elements
567specifies the API Level at which each element was introduced. The API Level
568for packages and classes is specified as "Since &lt;api level&gt;" at the
569top-right corner of the content area on each documentation page. The API Level
570for class members is specified in their detailed description headers,
571at the right margin. </p>
572
573
574
575
576
577
578
579
580
581