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