Home | History | Annotate | Download | only in manifest
      1 page.title=<uses-feature>
      2 parent.title=The AndroidManifest.xml File
      3 parent.link=manifest-intro.html
      4 @jd:body
      5 
      6 <div id="qv-wrapper">
      7 <div id="qv">
      8 
      9 
     10 <h2>In this document</h2>
     11 <ol>
     12   <li><a href="#market-feature-filtering">Android Market and Feature-Based Filtering</a>
     13     <ol>
     14       <li><a href="#declared">Filtering based on explicitly declared features</a></li>
     15       <li><a href="#implicit">Filtering based on implicit features</a></li>
     16       <li><a href="#bt-permission-handling">Special handling for Bluetooth feature</a></li>
     17       <li><a href="#testing">Testing the features required by your application</a></li>
     18     </ol>
     19   </li>
     20   <li><a href="#features-reference">Features Reference</a>
     21     <ol>
     22       <li><a href="#hw-features">Hardware features</a></li>
     23       <li><a href="#sw-features">Software features</a></li>
     24       <li><a href="#permissions">Permissions that Imply Feature Requirements</a></li>
     25     </ol>
     26   </li>
     27 </ol>
     28 </div>
     29 </div>
     30 
     31 
     32 <dl class="xml">
     33 
     34 <dt>syntax:</dt>
     35 <dd>
     36 <pre class="stx">&lt;uses-feature android:<a href="#name">name</a>="<em>string</em>"
     37               android:<a href="#required">required</a>=["true" | "false"]
     38               android:<a href="#glEsVersion">glEsVersion</a>="<em>integer</em>" /&gt;</pre>
     39 </dd>
     40 
     41 <dt>contained in:</dt>
     42 <dd><code><a
     43 href="{@docRoot}guide/topics/manifest/manifest-element.html">&lt;manifest&gt;</a></code></dd>
     44 
     45  <div class="sidebox-wrapper"> 
     46   <img id="rule" src="{@docRoot}assets/images/grad-rule-qv.png"> 
     47   <div id="qv-sub-rule"> 
     48     <img src="{@docRoot}assets/images/icon_market.jpg" style="float:left;margin:0;padding:0;"> 
     49     <p style="color:#669999;">Android Market and <code style="color:#669999;">&lt;uses-feature&gt;</code> elements</p>
     50     <p style="margin-top:1em;">Android Market filters the applications that are visible to users, so
     51 that users can see and download only those applications that are compatible with their
     52 devices. One of the ways Market filters applications is by feature compatibility.</p>
     53 
     54 <p style="margin-top:1em;">To do this, Market checks the
     55 <code>&lt;uses-feature&gt;</code> elements in each application's manifest, to
     56 establish the app's feature needs. Market then shows or hides the application to
     57 each user, based on a comparison with the features available on the user's
     58 device. </p>
     59 
     60 <p style="margin-top:1em;">By specifying the features that your application requires,
     61 you enable Android Market to present your application only to users whose
     62 devices meet the application's feature requirements, rather than presenting it
     63 to all users. </p>
     64 
     65 <p style="margin-top:1em;" class="caution">For important information about how
     66 Android Market uses features as the basis for filtering, please read <a
     67 href="#market-feature-filtering">Android Market and Feature-Based Filtering</a>,
     68 below.</p>
     69 </div>
     70 </div>
     71 
     72 <dt>description:</dt>
     73 <dd>Declares a single hardware or software feature that is used by the
     74 application.
     75 
     76 <p>The purpose of a <code>&lt;uses-feature&gt;</code> declaration is to inform
     77 any external entity of the set of hardware and software features on which your
     78 application depends. The element offers a <code>required</code> attribute that
     79 lets you specify whether your application requires and cannot function without
     80 the declared feature, or whether it prefers to have the feature but can function
     81 without it. Because feature support can vary across Android devices, the
     82 <code>&lt;uses-feature&gt;</code> element serves an important role in letting an
     83 application describe the device-variable features that it uses.</p>
     84 
     85 <p>The set of available features that your application declares corresponds to
     86 the set of feature constants made available by the Android {@link
     87 android.content.pm.PackageManager}, which are listed for
     88 convenience in the <a href="#features-reference">Features Reference</a> tables
     89 at the bottom of this document.
     90 
     91 <p>You must specify each feature in a separate <code>&lt;uses-feature&gt;</code>
     92 element, so if your application requires multiple features, it would declare
     93 multiple <code>&lt;uses-feature&gt;</code> elements. For example, an application
     94 that requires both Bluetooth and camera features in the device would declare
     95 these two elements:</p>
     96 
     97 <pre>
     98 &lt;uses-feature android:name="android.hardware.bluetooth" />
     99 &lt;uses-feature android:name="android.hardware.camera" />
    100 </pre>
    101 
    102 <p>In general, you should always make sure to declare
    103 <code>&lt;uses-feature&gt;</code> elements for all of the features that your
    104 application requires.</p>
    105 
    106 <p>Declared <code>&lt;uses-feature></code> elements are informational only, meaning
    107 that the Android system itself does not check for matching feature support on
    108 the device before installing an application. However, other services
    109 (such as Android Market) or applications may check your application's 
    110 <code>&lt;uses-feature></code> declarations as part of handling or interacting
    111 with your application. For this reason, it's very important that you declare all of
    112 the features (from the list below) that your application uses. </p>
    113 
    114 <p>For some features, there may exist a specific attribute that allows you to define
    115 a version of the feature, such as the version of Open GL used (declared with
    116 <a href="#glEsVersion"><code>glEsVersion</code></a>). Other features that either do or do not
    117 exist for a device, such as a camera, are declared using the
    118 <a href="#name"><code>name</code></a> attribute.</p>
    119 
    120 
    121 <p>Although the <code>&lt;uses-feature></code> element is only activated for
    122 devices running API Level 4 or higher, it is recommended to include these
    123 elements for all applications, even if the <a href="uses-sdk-element.html#min"><code>minSdkVersion</code></a>
    124 is "3" or lower. Devices running older versions of the platform will simply
    125 ignore the element.</p>
    126 
    127 <p class="note"><strong>Note:</strong> When declaring a feature, remember
    128 that you must also request permissions as appropriate. For example, you must
    129 still request the {@link android.Manifest.permission#CAMERA}
    130 permission before your application can access the camera API. Requesting the
    131 permission grants your application access to the appropriate hardware and
    132 software, while declaring the features used by your application ensures proper
    133 device compatibility.</p>
    134 
    135 </dd> 
    136 
    137 
    138 <dt>attributes:</dt>
    139 
    140 <dd>
    141 <dl class="attr">
    142 
    143   <dt><a name="name"></a><code>android:name</code></dt>
    144   <dd>Specifies a single hardware or software feature used by the application,
    145 as a descriptor string. Valid descriptor values are listed in the <a
    146 href="#hw-features">Hardware features</a> and <a href="#sw-features">Software
    147 features</a> tables, below. </dd>
    148 
    149   <dt><a name="required"></a><code>android:required</code></dt>  <!-- added in api level 5 -->
    150   <dd>Boolean value that indicates whether the application requires
    151   the feature specified in <code>android:name</code>.
    152 
    153 <ul>
    154 <li>When you declare <code>"android:required="true"</code> for a feature,
    155 you are specifying that the application <em>cannot function, or is not
    156 designed to function</em>, when the specified feature is not present on the
    157 device. </li>
    158 
    159 <li>When you declare <code>"android:required="false"</code> for a feature, it
    160 means that the application <em>prefers to use the feature</em> if present on
    161 the device, but that it <em>is designed to function without the specified
    162 feature</em>, if necessary. </li>
    163 
    164 </ul>
    165 
    166 <p>The default value for <code>android:required</code> if not declared is
    167 <code>"true"</code>.</p>
    168   </dd>
    169 
    170   <dt><a name="glEsVersion"></a><code>android:glEsVersion</code></dt>
    171   <dd>The OpenGL ES version required by the application. The higher 16 bits
    172 represent the major number and the lower 16 bits represent the minor number. For
    173 example, to specify OpenGL ES version 2.0, you would set the value as
    174 "0x00020000". To specify OpenGL ES 2.1, if/when such a version were made
    175 available, you would set the value as "0x00020001".
    176 
    177   <p>An application should specify at most one <code>android:glEsVersion</code>
    178 attribute in its manifest. If it specifies more than one, the
    179 <code>android:glEsVersion</code> with the numerically highest value is used and
    180 any other values are ignored.</p>
    181 
    182   <p>If an application does not specify an <code>android:glEsVersion</code>
    183 attribute, then it is assumed that the application requires only OpenGL ES 1.0,
    184 which is supported by all Android-powered devices.</p>
    185 
    186   <p>An application can assume that if a platform supports a given OpenGL ES
    187 version, it also supports all numerically lower OpenGL ES versions. Therefore,
    188 an application that requires both OpenGL ES 1.0 and OpenGL ES 2.0 must specify
    189 that it requires OpenGL ES 2.0.</p>
    190 
    191   <p>An application that can work with any of several OpenGL ES versions should
    192 only specify the numerically lowest version of OpenGL ES that it requires. (It
    193 can check at run-time whether a higher level of OpenGL ES is available.)</p>
    194   </dd>
    195 
    196 </dl>
    197 </dd>
    198 
    199 <!-- ##api level indication## -->
    200 <dt>introduced in:</dt>
    201 <dd>API Level 4</dd>
    202 
    203 <dt>see also:</dt>
    204 <dd>
    205   <ul>
    206     <li>{@link android.content.pm.PackageManager}</li>
    207     <li>{@link android.content.pm.FeatureInfo}</li>
    208     <li>{@link android.content.pm.ConfigurationInfo}</li>
    209     <li><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html"><code>&lt;uses-permission&gt;</code></a></li>
    210     <li><a href="{@docRoot}guide/appendix/market-filters.html">Android Market Filters</a></li>
    211   </ul>
    212 </dd>
    213 
    214 </dl>
    215 
    216 
    217 <h2 id="market-feature-filtering">Android Market and Feature-Based Filtering</h2>
    218 
    219 <p>Android Market filters the applications that are visible to users, so that
    220 users can see and download only those applications that are compatible with
    221 their devices. One of the ways Market filters applications is by feature
    222 compatibility.</p>
    223 
    224 <p>To determine an application's feature compatibility with a given user's
    225 device, the Android Market service compares:</p>
    226 
    227 <ul>
    228 <li>Features required by the application &mdash; an application declares features in
    229 <code>&lt;uses-feature&gt;</code> elements in its manifest <br/>with...</li>
    230 <li>Features available on the device, in hardware or software &mdash;
    231 a device reports the features it supports as read-only system properties.</li>
    232 </ul>
    233 
    234 <p>To ensure an accurate comparison of features, the Android Package Manager
    235 provides a shared set of feature constants that both applications and devices
    236 use to declare feature requirements and support. The available feature constants
    237 are listed in the <a href="#features-reference">Features Reference</a> tables at
    238 the bottom of this document, and in the class documentation for {@link
    239 android.content.pm.PackageManager}.</p>
    240 
    241 <p>When the user launches the Market application, the application queries the
    242 Package Manager for the list of features available on the device by calling
    243 {@link android.content.pm.PackageManager#getSystemAvailableFeatures()}. The
    244 Market application then passes the features list up to the Android Market
    245 service when establishing the session for the user.</p>
    246 
    247 <p>Each time you upload an application to the Android Market Publisher Site,
    248 Android Market scans the application's manifest file. It looks for
    249 <code>&lt;uses-feature&gt;</code> elements and evaluates them in combination
    250 with other elements, in some cases, such as <code>&lt;uses-sdk&gt;</code> and
    251 <code>&lt;uses-permission&gt;</code> elements. After establishing the
    252 application's set of required features, it stores that list internally as
    253 metadata associated with the application <code>.apk</code> and the application
    254 version. </p>
    255 
    256 <p>When a user searches or browses for applications using the Android Market
    257 application, the service compares the features needed by each application with
    258 the features available on the user's device. If all of an application's required
    259 features are present on the device, Android Market allows the user to see the
    260 application and potentially download it. If any required feature is not
    261 supported by the device, Android Market filters the application so that it is
    262 not visible to the user and not available for download. </p>
    263 
    264 <p>Because the features you declare in <code>&lt;uses-feature&gt;</code>
    265 elements directly affect how Android Market filters your application, it's
    266 important to understand how Android Market evaluates the application's manifest
    267 and establishes the set of required features. The sections below provide more
    268 information. </p>
    269 
    270 <h3 id="declared">Filtering based on explicitly declared features</h3>
    271 
    272 <p>An explicitly declared feature is one that your application declares in a
    273 <code>&lt;uses-feature&gt;</code> element. The feature declaration can include
    274 an <code>android:required=["true" | "false"]</code> attribute (if you are
    275 compiling against API level 5 or higher), which lets you specify whether the
    276 application absolutely requires the feature and cannot function properly without
    277 it (<code>"true"</code>), or whether the application prefers to use the feature
    278 if available, but is designed to run without it (<code>"false"</code>).</p>
    279 
    280 <p>Android Market handles explicitly declared features in this way: </p>
    281 
    282 <ul>
    283 <li>If a feature is explicitly declared as being required, Android Market adds
    284 the feature to the list of required features for the application. It then
    285 filters the application from users on devices that do not provide that feature.
    286 For example:
    287 <pre>&lt;uses-feature android:name="android.hardware.camera" android:required="true" /&gt;</pre></li>
    288 <li>If a feature is explicitly declared as <em>not</em> being required, Android
    289 Market <em>does not</em> add the feature to the list of required features. For
    290 that reason, an explicitly declared non-required feature is never considered when
    291 filtering the application. Even if the device does not provide the declared
    292 feature, Android Market will still consider the application compatible with the
    293 device and will show it to the user, unless other filtering rules apply. For
    294 example:
    295 <pre>&lt;uses-feature android:name="android.hardware.camera" android:required="false" /&gt;</pre></li>
    296 <li>If a feature is explicitly declared, but without an
    297 <code>android:required</code> attribute, Android Market assumes that the feature
    298 is required and sets up filtering on it. </li>
    299 </ul>
    300 
    301 <p>In general, if your application is designed to run on Android 1.6 and earlier
    302 versions, the <code>android:required</code> attribute is not available in the
    303 API and Android Market assumes that any and all
    304 <code>&lt;uses-feature&gt;</code> declarations are required. </p>
    305 
    306 <p class="note"><strong>Note:</strong> By declaring a feature explicitly and
    307 including an <code>android:required="false"</code> attribute, you can
    308 effectively disable all filtering on Android Market for the specified feature.
    309 </p>
    310 
    311 
    312 <h3 id="implicit">Filtering based on implicit features</h3>
    313 
    314 <p>An <em>implicit</em> feature is one that an application requires in order to
    315 function properly, but which is <em>not</em> declared in a
    316 <code>&lt;uses-feature&gt;</code> element in the manifest file. Strictly
    317 speaking, every application should <em>always</em> declare all features that it
    318 uses or requires, so the absence of a declaration for a feature used by an
    319 application should be considered an error. However, as a safeguard for users and
    320 developers, Android Market looks for implicit features in each application and
    321 sets up filters for those features, just as it would do for an explicitly
    322 declared feature. </p>
    323 
    324 <p>An application might require a feature but not declare it because: </p>
    325 
    326 <ul>
    327 <li>The application was compiled against an older version of the Android library
    328 (Android 1.5 or earlier) and the <code>&lt;uses-feature&gt;</code> element was
    329 not available.</li>
    330 <li>The developer incorrectly assumed that the feature would be present on all
    331 devices and a declaration was unnecessary.</li>
    332 <li>The developer omitted the feature declaration accidentally.</li>
    333 <li>The developer declared the feature explicitly, but the declaration was not
    334 valid. For example, a spelling error in the <code>&lt;uses-feature&gt;</code>
    335 element name or an unrecognized string value for the
    336 <code>android:name</code> attribute would invalidate the feature declaration.
    337 </li>
    338 </ul>
    339 
    340 <p>To account for the cases above, Android Market attempts to discover an
    341 application's implied feature requirements by examining <em>other elements</em>
    342 declared in the manifest file, specifically,
    343 <code>&lt;uses-permission&gt;</code> elements.</p>
    344 
    345 <p>If an application requests hardware-related permissions, Android Market
    346 <em>assumes that the application uses the underlying hardware features and
    347 therefore requires those features</em>, even though there might be no
    348 corresponding to <code>&lt;uses-feature&gt;</code> declarations. For such
    349 permissions, Android Market adds the underlying hardware features to the
    350 metadata that it stores for the application and sets up filters for them.</p>
    351 
    352 <p>For example, if an application requests the <code>CAMERA</code> permission
    353 but does not declare a <code>&lt;uses-feature&gt;</code> element for
    354 <code>android.hardware.camera</code>, Android Market considers that the
    355 application requires a camera and should not be shown to users whose devices do
    356 not offer a camera.</p>
    357 
    358 <p>If you don't want Android Market to filter based on a specific implied
    359 feature, you can disable that behavior. To do so, declare the feature explicitly
    360 in a <code>&lt;uses-feature&gt;</code> element and include an 
    361 <code>android:required="false"</code> attribute. For example, to disable
    362 filtering derived from the <code>CAMERA</code> permission, you would declare
    363 the feature as shown below.</p>
    364 
    365 <pre>&lt;uses-feature android:name="android.hardware.camera" android:required="false" /&gt;</pre>
    366 
    367 <p class="caution">It's important to understand that the permissions that you
    368 request in <code>&lt;uses-permission&gt;</code> elements can directly affect how
    369 Android Market filters your application. The reference section <a
    370 href="#permissions">Permissions that Imply Feature Requirements</a>,
    371 below, lists the full set of permissions that imply feature requirements and
    372 therefore trigger filtering.</p>
    373 
    374 <h3 id="bt-permission-handling">Special handling for Bluetooth feature</h3>
    375 
    376 <p>Android Market applies slightly different rules than described above, when
    377 determining filtering for Bluetooth.</p>
    378 
    379 <p>If an application declares a Bluetooth permission in a
    380 <code>&lt;uses-permission&gt;</code> element, but does not explicitly declare
    381 the Bluetooth feature in a <code>&lt;uses-feature&gt;</code> element, Android
    382 Market checks the version(s) of the Android platform on which the application is
    383 designed to run, as specified in the <code>&lt;uses-sdk&gt;</code> element. </p>
    384 
    385 <p>As shown in the table below, Android Market enables filtering for the
    386 Bluetooth feature only if the application declares its lowest or targeted
    387 platform as Android 2.0 (API level 5) or higher. However, note that Android
    388 market applies the normal rules for filtering when the application explicitly
    389 declares the Bluetooth feature in a <code>&lt;uses-feature&gt;</code> element.
    390 </p>
    391 
    392 <p class="caption"><strong>Table 1.</strong> How Android Market determines the
    393 Bluetooth feature requirement for an application that requests a Bluetooth
    394 permission but does not declare the Bluetooth feature in a
    395 <code>&lt;uses-feature&gt;</code> element.</p>
    396 
    397 <table style="margin-top:1em;">
    398 <tr>
    399 <th><nobr>If <code>minSdkVersion</code> is ...</nobr></th>
    400 <th><nobr>or <code>targetSdkVersion</code> is</nobr></th>
    401 <th>Result</th>
    402 </tr>
    403 <tr>
    404 <td><nobr>&lt;=4 (or uses-sdk is not declared)</nobr></td>
    405 <td>&lt;=4</td>
    406 <td>Android Market <em>will not</em> filter the application from any devices
    407 based on their reported support for the <code>android.hardware.bluetooth</code>
    408 feature.</td>
    409 </tr>
    410 <tr>
    411 <td>&lt;=4</td>
    412 <td>&gt;=5</td>
    413 <td rowspan="2">Android Market filters the application from any devices that
    414 do not support the <code>android.hardware.bluetooth</code> feature (including
    415 older releases).</td>
    416 </tr>
    417 <tr>
    418 <td>&gt;=5</td>
    419 <td>&gt;=5</td>
    420 </tr>
    421 </table>
    422 
    423 <p>The examples below illustrate the different filtering effects, based on how
    424 Android Market handles the Bluetooth feature. </p>
    425 
    426 <dl>
    427 <dt>In first example, an application that is designed to run on older API levels
    428 declares a Bluetooth permission, but does not declare the Bluetooth feature in a
    429 <code>&lt;uses-feature&gt;</code> element.</dt>
    430 <dd><em>Result:</em> Android Market does not filter the application from any device.</dd>
    431 </dl>
    432 
    433 <pre>&lt;manifest ...>
    434     &lt;uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
    435     &lt;uses-sdk android:minSdkVersion="3" />
    436     ...
    437 &lt;/manifest></pre>
    438 
    439 <dl>
    440 <dt>In the second example, below, the same application also declares a target
    441 API level of "5". </dt>
    442 <dd><em>Result:</em> Android Market now assumes that the feature is required and
    443 will filter the application from all devices that do not report Bluetooth support,
    444 including devices running older versions of the platform. </dd>
    445 </dl>
    446 
    447 <pre>&lt;manifest ...>
    448     &lt;uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
    449     &lt;uses-sdk android:minSdkVersion="3" android:targetSdkVersion="5" />
    450     ...
    451 &lt;/manifest></pre>
    452 
    453 <dl>
    454 <dt>Here the same application now specifically declares the Bluetooth feature.</dt>
    455 <dd><em>Result:</em> Identical to the previous example (filtering is applied).</dd>
    456 </dl>
    457 
    458 <pre>&lt;manifest ...>
    459     &lt;uses-feature android:name="android.hardware.bluetooth" />
    460     &lt;uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
    461     &lt;uses-sdk android:minSdkVersion="3" android:targetSdkVersion="5" />
    462     ...
    463 &lt;/manifest></pre>
    464 
    465 <dl>
    466 <dt>Finally, in the case below, the same application adds an
    467 <code>android:required="false"</code> attribute.</dt>
    468 <dd><em>Result:</em> Android Market disables filtering based on Bluetooth
    469 feature support, for all devices.</dd>
    470 </dl>
    471 
    472 <pre>&lt;manifest ...>
    473     &lt;uses-feature android:name="android.hardware.bluetooth" android:required="false" />
    474     &lt;uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
    475     &lt;uses-sdk android:minSdkVersion="3" android:targetSdkVersion="5" />
    476     ...
    477 &lt;/manifest></pre>
    478 
    479 
    480 
    481 <h3 id="testing">Testing the features required by your application</h3>
    482 
    483 <p>You can use the <code>aapt</code> tool, included in the Android SDK, to
    484 determine how Android Market will filter your application, based on its declared
    485 features and permissions. To do so, run  <code>aapt</code> with the <code>dump
    486 badging</code> command. This causes <code>aapt</code> to parse your
    487 application's manifest and apply the same rules as used by Android Market to
    488 determine the features that your application requires. </p>
    489 
    490 <p>To use the tool, follow these steps: </p>
    491 
    492 <ol>
    493 <li>First, build and export your application as an unsigned <code>.apk</code>.
    494 If you are developing in Eclipse with ADT, right-click the project and select
    495 <strong>Android Tools</strong> &gt; <strong>Export Unsigned Application
    496 Package</strong>. Select a destination filename and path and click
    497 <strong>OK</strong>. </li>
    498 <li>Next, locate the <code>aapt</code> tool, if it is not already in your PATH.
    499 If you are using SDK Tools r8 or higher, you can find <code>aapt</code> in the
    500 <code>&lt;<em>SDK</em>&gt;/platform-tools/</code> directory.
    501 <p class="note"><strong>Note:</strong> You must use the version of
    502 <code>aapt</code> that is provided for the latest Platform-Tools component available. If
    503 you do not have the latest Platform-Tools component, download it using the <a
    504 href="{@docRoot}sdk/adding-components.html">Android SDK and AVD Manager</a>.
    505 </p></li>
    506 <li>Run <code>aapt</code> using this syntax: </li>
    507 </ol>
    508 
    509 <pre>$ aapt dump badging &lt;<em>path_to_exported_.apk</em>&gt;</pre>
    510 
    511 <p>Here's an example of the command output for the second Bluetooth example, above: </p>
    512 
    513 <pre>$ ./aapt dump badging BTExample.apk
    514 package: name='com.example.android.btexample' versionCode='' versionName=''
    515 <strong>uses-permission:'android.permission.BLUETOOTH_ADMIN'</strong>
    516 <strong>uses-feature:'android.hardware.bluetooth'</strong>
    517 sdkVersion:'3'
    518 targetSdkVersion:'5'
    519 application: label='BT Example' icon='res/drawable/app_bt_ex.png'
    520 launchable activity name='com.example.android.btexample.MyActivity'label='' icon=''
    521 uses-feature:'android.hardware.touchscreen'
    522 main
    523 supports-screens: 'small' 'normal' 'large'
    524 locales: '--_--'
    525 densities: '160'
    526 </pre>
    527 
    528 
    529 <h2 id=features-reference>Features Reference</h2>
    530 
    531 <p>The tables below provide reference information about hardware and software
    532 features and the permissions that can imply them on Android Market. </p>
    533 
    534 <h3 id="hw-features">Hardware features</h3>
    535 
    536 <p>The table below describes the hardware feature descriptors supported by the
    537 most current platform release. To signal that your application uses or requires
    538 a hardware feature, declare each value in a <code>android:name</code> attribute
    539 in a separate <code>&lt;uses-feature&gt;</code> element. </p>
    540 
    541   <table>
    542     <tr>
    543        <th>Feature Type</th>
    544        <th>Feature Descriptor</th>
    545        <th style="min-width:170px">Description</th>
    546        <th>Comments</th>
    547     </tr>
    548     <tr>
    549        <td>Audio</td>
    550        <td><code>android.hardware.audio.low_latency</td>
    551        <td>The application uses a low-latency audio pipeline on the device and
    552 is sensitive to delays or lag in sound input or output.</td>
    553 <td>
    554 </td>
    555     </tr>
    556     <tr>
    557        <td>Bluetooth</td>
    558        <td><code>android.hardware.bluetooth</td>
    559        <td>The application uses Bluetooth radio features in the device.</td>
    560 <td>
    561 </td>
    562     </tr>
    563     <tr>
    564        <td rowspan="4">Camera</td>
    565        <td><code>android.hardware.camera</code></td>
    566        <td>The application uses the device's camera. If the device supports
    567            multiple cameras, the application uses the camera that facing
    568            away from the screen.</td>
    569        <td></td>
    570     </tr>
    571 <tr>
    572   <td><code>android.hardware.camera.autofocus</code></td>
    573   <td>Subfeature. The application uses the device camera's autofocus capability.</td>
    574   <td rowspan="3">These subfeatures implicitly declare the
    575 <code>android.hardware.camera</code> parent feature, unless declared with
    576 <code>android:required="false"</code>.</td>
    577 </tr>
    578 <tr>
    579   <td><code>android.hardware.camera.flash</code></td>
    580   <td>Subfeature. The application uses the device camera's flash.</td>
    581 </tr>
    582 <tr>
    583   <td><code>android.hardware.camera.front</code></td>
    584   <td>Subfeature. The application uses a front-facing camera on the device.</td>
    585 </tr>
    586 
    587 <tr>
    588   <td rowspan="3">Location</td>
    589   <td><code>android.hardware.location</code></td>
    590   <td>The application uses one or more features on the device for determining
    591 location, such as GPS location, network location, or cell location.</td>
    592   <td></td>
    593 </tr>
    594 <tr>
    595   <td><code>android.hardware.location.network</code></td>
    596   <td>Subfeature. The application uses coarse location coordinates obtained from
    597 a network-based geolocation system supported on the device.</td>
    598   <td rowspan="2">These subfeatures implicitly declare the
    599 <code>android.hardware.location</code> parent feature, unless declared with
    600 <code>android:required="false"</code>. </td>
    601 </tr>
    602 <tr>
    603   <td><code>android.hardware.location.gps</code></td>
    604   <td>Subfeature. The application uses precise location coordinates obtained
    605 from a Global Positioning System receiver on the device. </td>
    606 </tr>
    607 <tr>
    608   <td>Microphone</td>
    609   <td><code>android.hardware.microphone</code></td>
    610   <td>The application uses a microphone on the device.
    611   </td>
    612   <td></td>
    613 </tr>
    614 <tr>
    615   <td>NFC</td>
    616   <td><code>android.hardware.nfc</td>
    617   <td>The application uses Near Field Communications radio features in the device.</td>
    618   <td></td>
    619 </tr>
    620 <tr>
    621   <td rowspan="6">Sensors</td>
    622   <td><code>android.hardware.sensor.accelerometer</code></td>
    623   <td>The application uses motion readings from an accelerometer on the
    624 device.</td>
    625   <td></td>
    626 </tr>
    627 <tr>
    628   <td><code>android.hardware.sensor.barometer</code></td>
    629   <td>The application uses the device's barometer.</td>
    630   <td></td>
    631 </tr>
    632 <tr>
    633   <td><code>android.hardware.sensor.compass</code></td>
    634   <td>The application uses directional readings from a magnetometer (compass) on
    635 the device.</td>
    636   <td></td>
    637 </tr>
    638 <tr>
    639   <td><code>android.hardware.sensor.gyroscope</code></td>
    640   <td>The application uses the device's gyroscope sensor.</td>
    641   <td></td>
    642 </tr>
    643 <tr>
    644   <td><code>android.hardware.sensor.light</code></td>
    645   <td>The application uses the device's light sensor.</td>
    646   <td></td>
    647 </tr>
    648 <tr>
    649   <td><code>android.hardware.sensor.proximity</code></td>
    650   <td>The application uses the device's proximity sensor.</td>
    651   <td></td>
    652 </tr>
    653 
    654 <tr>
    655   <td rowspan="2">Screen</td>
    656   <td><code>android.hardware.screen.landscape</code></td>
    657   <td>The application requires landscape orientation.</td>
    658   <td rowspan="2">
    659      <p>For example, if your app requires portrait orientation, you should declare
    660 <code>&lt;uses-feature android:name="android.hardware.screen.portrait"/></code> so that only devices
    661 that support portrait orientation (whether always or by user choice) can install your app. If your
    662 application <em>supports</em> both orientations, then you don't need to declare either.</p>
    663     <p>Both orientations are assumed <em>not required</em>, by default, so your app may be installed
    664 on devices that support one or both orientations. However, if any of your activities request that
    665 they run in a specific orientation, using the <a
    666 href="{@docRoot}guide/topics/manifest/activity-element.html#screen">{@code
    667 android:screenOrientation}</a> attribute, then this also declares that the application requires that
    668 orientation. For example, if you declare <a
    669 href="{@docRoot}guide/topics/manifest/activity-element.html#screen">{@code
    670 android:screenOrientation}</a> with either {@code "landscape"}, {@code "reverseLandscape"}, or
    671 {@code "sensorLandscape"}, then your application will be available only to devices that support
    672 landscape orientation. As a best practice, you should still declare your requirement for this
    673 orientation using a {@code &lt;uses-feature&gt;} element. If you declare an orientation for your
    674 activity using <a href="{@docRoot}guide/topics/manifest/activity-element.html#screen">{@code
    675 android:screenOrientation}</a>, but don't actually <em>require</em> it, you can disable the
    676 requirement by declaring the orientation with a {@code &lt;uses-feature&gt;} element and include
    677 {@code android:required="false"}.</p>
    678     <p>For backwards compatibility, any device running a platform version that supports only API
    679 level 12 or lower is assumed to support both landscape and portrait.</p>
    680   </td>
    681 </tr>
    682 <tr>
    683   <td><code>android.hardware.screen.portrait</code></td>
    684   <td>The application requires portrait orientation.</td>
    685 </tr>
    686 
    687 <tr>
    688   <td rowspan="3">Telephony</td>
    689   <td><code>android.hardware.telephony</code></td>
    690   <td>The application uses telephony features on the device, such as telephony
    691 radio with data communication services.</td>
    692   <td></td>
    693 </tr>
    694 <tr>
    695   <td><code>android.hardware.telephony.cdma</code></td>
    696   <td>Subfeature. The application uses CDMA telephony radio features on the
    697 device. </td>
    698   <td rowspan="2">These subfeatures implicitly declare the
    699 <code>android.hardware.telephony</code> parent feature, unless declared with
    700 <code>android:required="false"</code>. </td>
    701 </tr>
    702 <tr>
    703   <td><code>android.hardware.telephony.gsm</code></td>
    704   <td>Subfeature. The application uses GSM telephony radio features on the
    705 device.</td>
    706 </tr>
    707 
    708 <tr>
    709   <td rowspan="7">Touchscreen</td>
    710   <td><code>android.hardware.faketouch</code></td>
    711   <td>The application uses basic touch interaction events, such as "click down", "click
    712 up", and drag.</td>
    713   <td><p>When declared as required, this indicates that the application is compatible with a device
    714 only if it offers an emulated touchscreen ("fake touch" interface), or better. A device that offers
    715 a fake touch interface provides a user input system that emulates a subset of touchscreen
    716 capabilities. For example, a mouse or remote control that drives an on-screen cursor provides a fake
    717 touch interface. If your application requires basic point and click interaction (in other
    718 words, it won't work with <em>only</em> a d-pad controller), you should declare this feature.
    719 Because this is the minimum level of touch interaction, your app will also be compatible with
    720 devices that offer more complex touch interfaces.</p>
    721   <p class="note"><strong>Note:</strong> Because applications require the {@code
    722 android.hardware.touchscreen} feature by default, if you want your application to be available to
    723 devices that provide a fake touch interface, you must also explicitly declare that a touch screen is
    724 <em>not</em> required by declaring {@code &lt;uses-feature
    725 android:name="android.hardware.touchscreen" <strong>android:required="false"</strong>
    726 /&gt;}</p></td>
    727 </tr>
    728 
    729 <tr>
    730   <td><code>android.hardware.faketouch.multitouch.distinct</code></td>
    731   <td>The application performs distinct tracking of two or more "fingers" on a fake touch
    732 interface. This is a superset of the faketouch feature.</td>
    733   <td><p>When declared as required, this indicates that the application is compatible with a device
    734 only if it supports touch emulation for events that supports distinct tracking of two or more
    735 fingers, or better.</p>
    736   <p>Unlike the distinct multitouch defined by {@code
    737 android.hardware.touchscreen.multitouch.distinct}, input devices that support distinct multi-touch
    738 with a fake touch interface will not support all two-finger gestures, because the input is
    739 being transformed to cursor movement on the screen. That is, single finger gestures on such a device
    740 move a cursor; two-finger swipes will result in single-finger touch events; other two-finger
    741 gestures will result in the corresponding two-finger touch event. An example device that supports
    742 distinct multi-touch with a fake touch interface is one that provides a trackpad for cursor movement
    743 which also supports two or more fingers.</p></td>
    744 </tr>
    745 
    746 <tr>
    747   <td><code>android.hardware.faketouch.multitouch.jazzhand</code></td>
    748   <td>The application performs distinct tracking of five or more "fingers" on a fake touch
    749 interface. This is a superset of the faketouch feature.</td>
    750   <td><p>When declared as required, this indicates that the application is compatible with a device
    751 only if it supports touch emulation for events that supports distinct tracking of five or more
    752 fingers.</p>
    753   <p>Unlike the distinct multitouch defined by {@code
    754 android.hardware.touchscreen.multitouch.jazzhand}, input devices that support jazzhand multi-touch
    755 with a fake touch interface will not support all five-finger gestures, because the input is being
    756 transformed to cursor movement on the screen. That is, single finger gestures on such a device move
    757 a cursor; multi-finger gestures will result in single-finger touch events; other multi-finger
    758 gestures will result in the corresponding multi-finger touch event. An example device that supports
    759 distinct multi-touch with a fake touch interface is one that provides a trackpad for cursor movement
    760 which also supports five or more fingers.</p></td>
    761 </tr>
    762 
    763 <tr>
    764   <td><code>android.hardware.touchscreen</code></td>
    765   <td>The application uses touchscreen capabilities for gestures that are more interactive
    766 than basic touch events, such as a fling. This is a superset of the basic faketouch feature.</td>
    767   <td><p>By default, your application requires this. As such, your application is <em>not</em>
    768 available to devices that provide only an emulated touch interface ("fake touch"), by default. If
    769 you want your application available to devices that provide a fake touch interface (or even devices
    770 that provide only a d-pad controller), you must explicitly declare that a touch screen is not
    771 required, by declaring {@code android.hardware.touchscreen} with {@code android:required="false"}.
    772 You should do so even if your application uses&mdash;but does not <em>require</em>&mdash;a real
    773 touch screen interface.</p>
    774 <p>If your application <em>does require</em> a touch interface (in order to perform touch
    775 gestures such as a fling), then you don't need to do anything, because this is required by default.
    776 However, it's best if you explicitly declare all features used by your application, so you should
    777 still declare this if your app uses it.</p>
    778   <p>If you require more complex touch interaction, such as multi-finger gestures, you
    779 should declare the advanced touch screen features below.</p></td>
    780 </tr>
    781 <tr>
    782   <td><code>android.hardware.touchscreen.multitouch</code></td>
    783   <td>The application uses basic two-point multitouch capabilities on the device
    784 screen, such as for pinch gestures, but does not need to track touches independently. This
    785 is a superset of touchscreen feature.</td>
    786   <td>This implicitly declares the <code>android.hardware.touchscreen</code> parent feature, unless
    787 declared with <code>android:required="false"</code>. </td>
    788 </tr>
    789 <tr>
    790   <td><code>android.hardware.touchscreen.multitouch.distinct</code></td>
    791   <td>Subfeature. The application uses advanced multipoint multitouch
    792 capabilities on the device screen, such as for tracking two or more points fully
    793 independently. This is a superset of multitouch feature.</td>
    794   <td rowspan="2">This implicitly declares the <code>android.hardware.touchscreen.multitouch</code>
    795 parent feature, unless declared with <code>android:required="false"</code>. </td>
    796 </tr>
    797 <tr>
    798   <td><code>android.hardware.touchscreen.multitouch.jazzhand</code></td>
    799   <td>The application uses advanced multipoint multitouch
    800 capabilities on the device screen, for tracking up to five points fully
    801 independently. This is a superset of distinct multitouch feature.</td>
    802 </tr>
    803 
    804 <tr>
    805   <td rowspan="2">USB</td>
    806   <td><code>android.hardware.usb.host</code></td>
    807   <td>The application uses USB host mode features (behaves as the host and connects to USB
    808 devices).</td>
    809   <td></td>
    810 </tr>
    811 
    812 <tr>
    813   <td><code>android.hardware.usb.accessory</code></td>
    814   <td>The application uses USB accessory features (behaves as the USB device and connects to USB
    815 hosts).</td>
    816   <td></td>
    817 </tr>
    818 
    819 <tr>
    820   <td>Wifi</td>
    821   <td><code>android.hardware.wifi</code></td>
    822   <td>The application uses 802.11 networking (wifi) features on the device.</td>
    823   <td></td>
    824 </tr>
    825 
    826   </table>
    827 
    828 <h3 id="sw-features">Software features</h3>
    829 
    830 <p>The table below describes the software feature descriptors supported by the
    831 most current platform release. To signal that your application uses or requires
    832 a software feature, declare each value in a <code>android:name</code> attribute
    833 in a separate <code>&lt;uses-feature&gt;</code> element. </p>
    834 
    835 
    836   <table>
    837 <tr> 
    838   <th>Feature</th>
    839   <th>Attribute Value</th> 
    840   <th>Description</th>
    841   <th>Comments</th>
    842 </tr>
    843 <tr>
    844   <td>Live Wallpaper</td>
    845   <td><code>android.software.live_wallpaper</code></td>
    846   <td>The application uses or provides Live Wallpapers.</td>
    847   <td></td>
    848 </tr>
    849 <tr>
    850   <td rowspan="2">SIP/VOIP</td>
    851   <td><code>android.software.sip</code></td>
    852   <td>The application uses SIP service on the device.
    853   </td>
    854   <td></td>
    855 </tr>
    856 <tr>
    857   <td><code>android.software.sip.voip</code></td>
    858   <td>Subfeature. The application uses SIP-based VOIP service on the device.
    859   </td>
    860   <td>This subfeature implicitly declares the <code>android.software.sip</code> parent feature,
    861 unless declared with <code>android:required="false"</code>.</td>
    862 </tr>
    863   </table>
    864 
    865 
    866 <h3 id="permissions">Permissions that Imply Feature Requirements</h3>
    867 
    868 <p>Some feature constants listed in the tables above were made available to
    869 applications <em>after</em> the corresponding API; for example, the
    870 <code>android.hardware.bluetooth</code> feature was added in Android 2.2 (API
    871 level 8), but the bluetooth API that it refers to was added in Android 2.0 (API
    872 level 5). Because of this, some apps were able to use the API before they had
    873 the ability to declare that they require the API via the
    874 <code>&lt;uses-feature&gt;</code> system. </p>
    875 
    876 <p>To prevent those apps from being made available unintentionally,  Android
    877 Market assumes that certain hardware-related permissions indicate that the
    878 underlying hardware features are required by default. For instance, applications
    879 that use Bluetooth must request the <code>BLUETOOTH</code> permission in a
    880 <code>&lt;uses-permission&gt;</code> element &mdash; for legacy apps, Android
    881 Market assumes that the permission declaration means that the underlying
    882 <code>android.hardware.bluetooth</code> feature is required by the application
    883 and sets up filtering based on that feature. </p>
    884 
    885 <p>The table below lists permissions that imply feature requirements
    886 equivalent to those declared in <code>&lt;uses-feature&gt;</code> elements. Note
    887 that <code>&lt;uses-feature&gt;</code> declarations, including any declared
    888 <code>android:required</code> attribute, always take precedence over features
    889 implied by the permissions below. </p>
    890 
    891 <p>For any of the permissions below, you can disable filtering based on the
    892 implied feature by explicitly declaring the implied feature explicitly, in a
    893 <code>&lt;uses-feature&gt;</code> element, with an
    894 <code>android:required="false"</code> attribute. For example, to disable any
    895 filtering based on the <code>CAMERA</code> permission, you would add this
    896 <code>&lt;uses-feature&gt;</code> declaration to the manifest file:</p>
    897 
    898 <pre>&lt;uses-feature android:name="android.hardware.camera" android:required="false" /&gt;</pre>
    899 
    900 <table id="permissions-features" >
    901   <tr> 
    902     <th>Category</th>
    903     <th>This Permission...</th>
    904     <th>Implies This Feature Requirement</th>
    905     <!-- <th>Comments</th> -->
    906   </tr>
    907 
    908 
    909 <tr>
    910   <td rowspan="2">Bluetooth</td>
    911   <td><code>BLUETOOTH</code></td>
    912   <td><code>android.hardware.bluetooth</code>
    913 <p>(See <a href="#bt-permission-handling">Special handling for Bluetooth feature</a> for details.)</p></td>
    914 <!--  <td></td> -->
    915 </tr>
    916 <tr>
    917   <td><code>BLUETOOTH_ADMIN</code></td>
    918   <td><code>android.hardware.bluetooth</code></td>
    919 <!--  <td></td> -->
    920 </tr>
    921 
    922 <tr>
    923   <td>Camera</td>
    924   <td><code>CAMERA</code></td>
    925   <td><code>android.hardware.camera</code> <em>and</em>
    926 <br><code>android.hardware.camera.autofocus</code></td>
    927 <!--  <td></td> -->
    928 </tr>
    929 
    930 <tr>
    931   <td rowspan="5">Location</td>
    932   <td><code>ACCESS_MOCK_LOCATION</code></td>
    933   <td><code>android.hardware.location</code></td>
    934 <!--  <td></td> -->
    935 </tr>
    936 <tr>
    937   <td><code>ACCESS_LOCATION_EXTRA_COMMANDS</code></td>
    938   <td><code>android.hardware.location</code></td>
    939 <!--  <td></td> -->
    940 </tr>
    941 <tr>
    942   <td><code>INSTALL_LOCATION_PROVIDER</code></td>
    943   <td><code>android.hardware.location</code></td>
    944 <!--  <td></td> -->
    945 </tr>
    946 <tr>
    947   <td><code>ACCESS_COARSE_LOCATION</code></td>
    948   <td><code>android.hardware.location.network</code> <em>and</em>
    949 <br><code>android.hardware.location</code></td>
    950 <!--  <td></td> -->
    951 </tr>
    952 <tr>
    953   <td><code>ACCESS_FINE_LOCATION</code></td>
    954   <td><code>android.hardware.location.gps</code> <em>and</em>
    955 <br><code>android.hardware.location</code></td>
    956 <!--  <td></td> -->
    957 </tr>
    958 
    959 <tr>
    960   <td>Microphone</td>
    961   <td><code>RECORD_AUDIO</code></td>
    962   <td><code>android.hardware.microphone</code></td>
    963 <!--  <td></td> -->
    964 </tr>
    965 
    966 <tr>
    967   <td rowspan="11">Telephony</td>
    968   <td><code>CALL_PHONE</code></td>
    969   <td><code>android.hardware.telephony</code></td>
    970 <!--  <td></td> -->
    971 </tr>
    972 <tr>
    973   <td><code>CALL_PRIVILEGED</code></td>
    974   <td><code>android.hardware.telephony</code></td>
    975 <!--  <td></td> -->
    976 </tr>
    977 
    978 <tr>
    979   <td><code>MODIFY_PHONE_STATE</code></td>
    980   <td><code>android.hardware.telephony</code></td>
    981 <!--  <td></td> -->
    982 </tr>
    983 <tr>
    984   <td><code>PROCESS_OUTGOING_CALLS</code></td>
    985   <td><code>android.hardware.telephony</code></td>
    986 <!--  <td></td> -->
    987 </tr>
    988 <tr>
    989   <td><code>READ_SMS</code></td>
    990   <td><code>android.hardware.telephony</code></td>
    991 <!--  <td></td> -->
    992 </tr>
    993 <tr>
    994   <td><code>RECEIVE_SMS</code></td>
    995   <td><code>android.hardware.telephony</code></td>
    996 <!--  <td></td> -->
    997 </tr>
    998 <tr>
    999   <td><code>RECEIVE_MMS</code></td>
   1000   <td><code>android.hardware.telephony</code></td>
   1001 <!--  <td></td> -->
   1002 </tr>
   1003 <tr>
   1004   <td><code>RECEIVE_WAP_PUSH</code></td>
   1005   <td><code>android.hardware.telephony</code></td>
   1006 <!--  <td></td> -->
   1007 </tr>
   1008 <tr>
   1009   <td><code>SEND_SMS</code></td>
   1010   <td><code>android.hardware.telephony</code></td>
   1011 <!--  <td></td> -->
   1012 </tr>
   1013 <tr>
   1014   <td><code>WRITE_APN_SETTINGS</code></td>
   1015   <td><code>android.hardware.telephony</code></td>
   1016 <!--  <td></td> -->
   1017 </tr>
   1018 <tr>
   1019   <td><code>WRITE_SMS</code></td>
   1020   <td><code>android.hardware.telephony</code></td>
   1021 <!--  <td></td> -->
   1022 </tr>
   1023 
   1024 <tr>
   1025   <td rowspan="3">Wifi</td>
   1026   <td><code>ACCESS_WIFI_STATE</code></td>
   1027   <td><code>android.hardware.wifi</code></td>
   1028 <!--  <td></td> -->
   1029 </tr>
   1030 <tr>
   1031   <td><code>CHANGE_WIFI_STATE</code></td>
   1032   <td><code>android.hardware.wifi</code></td>
   1033 <!--  <td></td> -->
   1034 </tr>
   1035 <tr>
   1036   <td><code>CHANGE_WIFI_MULTICAST_STATE</code></td>
   1037   <td><code>android.hardware.wifi</code></td>
   1038 <!--  <td></td> -->
   1039 </tr>
   1040 </table>