uses-feature-element.jd revision f1e134ba6ae61353e431e5e95b7d4520c82edc9d
1page.title=<uses-feature>
2@jd:body
3
4<dl class="xml">
5
6<dt>syntax:</dt>
7<dd>
8<pre class="stx">&lt;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>" /&gt;</pre>
11</dd>
12
13<dt>contained in:</dt>
14<dd><code><a
15href="{@docRoot}guide/topics/manifest/manifest-element.html">&lt;manifest&gt;</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;">&lt;uses-feature&gt;</code> elements</p>
22    <p style="margin-top:1em;">Android Market filters the applications that are visible to users, so
23that users can see and download only those applications that are compatible with their
24devices. 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>&lt;uses-feature&gt;</code> elements in each application's manifest, to
28establish the app's feature needs. Market then shows or hides the application to
29each user, based on a comparison with the features available on the user's
30device. </p>
31
32<p style="margin-top:1em;">By specifying the features that your application requires,
33you enable Android Market to present your application only to users whose
34devices meet the application's feature requirements, rather than presenting it
35to all users. </p>
36
37<p style="margin-top:1em;" class="caution">For important information about how
38Android Market uses features as the basis for filtering, please read <a
39href="#market-feature-filtering">Android Market and Feature-Based Filtering</a>,
40below.</p>
41</div>
42</div>
43
44<dt>description:</dt>
45<dd>Declares a single hardware or software feature that is used by the
46application.
47
48<p>The purpose of a <code>&lt;uses-feature&gt;</code> declaration is to inform
49any external entity of the set of hardware and software features on which your
50application depends. The element offers a <code>required</code> attribute that
51lets you specify whether your application requires and cannot function without
52the declared feature, or whether it prefers to have the feature but can function
53without it. Because feature support can vary across Android devices, the
54<code>&lt;uses-feature&gt;</code> element serves an important role in letting an
55application describe the device-variable features that it uses.</p>
56
57<p>The set of available features that your application declares corresponds to
58the set of feature constants made available by the Android {@link
59android.content.pm.PackageManager}, which are listed for
60convenience in the <a href="#features-reference">Features Reference</a> tables
61at the bottom of this document.
62
63<p>You must specify each feature in a separate <code>&lt;uses-feature&gt;</code>
64element, so if your application requires multiple features, it would declare
65multiple <code>&lt;uses-feature&gt;</code> elements. For example, an application
66that requires both Bluetooth and camera features in the device would declare
67these two elements:</p>
68
69<pre>
70&lt;uses-feature android:name="android.hardware.bluetooth" />
71&lt;uses-feature android:name="android.hardware.camera" />
72</pre>
73
74<p>In general, you should always make sure to declare
75<code>&lt;uses-feature&gt;</code> elements for all of the features that your
76application requires.</p>
77
78<p>Declared <code>&lt;uses-feature></code> elements are informational only, meaning
79that the Android system itself does not check for matching feature support on
80the device before installing an application. However, other services
81(such as Android Market) or applications may check your application's 
82<code>&lt;uses-feature></code> declarations as part of handling or interacting
83with your application. For this reason, it's very important that you declare all of
84the 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
87a 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
89exist 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>&lt;uses-feature></code> element is only activated for
94devices running API Level 4 or higher, it is recommended to include these
95elements for all applications, even if the <a href="uses-sdk-element.html#min"><code>minSdkVersion</code></a>
96is "3" or lower. Devices running older versions of the platform will simply
97ignore the element.</p>
98
99<p class="note"><strong>Note:</strong> When declaring a feature, remember
100that you must also request permissions as appropriate. For example, you must
101still request the {@link android.Manifest.permission#CAMERA}
102permission before your application can access the camera API. Requesting the
103permission grants your application access to the appropriate hardware and
104software, while declaring the features used by your application ensures proper
105device 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,
117as a descriptor string. Valid descriptor values are listed in the <a
118href="#hw-features">Hardware features</a> and <a href="#sw-features">Software
119features</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,
127you are specifying that the application <em>cannot function, or is not
128designed to function</em>, when the specified feature is not present on the
129device. </li>
130
131<li>When you declare <code>"android:required="false"</code> for a feature, it
132means that the application <em>prefers to use the feature</em> if present on
133the device, but that it <em>is designed to function without the specified
134feature</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
144represent the major number and the lower 16 bits represent the minor number. For
145example, 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
147available, you would set the value as "0x00020001".
148
149  <p>An application should specify at most one <code>android:glEsVersion</code>
150attribute in its manifest. If it specifies more than one, the
151<code>android:glEsVersion</code> with the numerically highest value is used and
152any other values are ignored.</p>
153
154  <p>If an application does not specify an <code>android:glEsVersion</code>
155attribute, then it is assumed that the application requires only OpenGL ES 1.0,
156which is supported by all Android-powered devices.</p>
157
158  <p>An application can assume that if a platform supports a given OpenGL ES
159version, it also supports all numerically lower OpenGL ES versions. Therefore,
160an application that requires both OpenGL ES 1.0 and OpenGL ES 2.0 must specify
161that it requires OpenGL ES 2.0.</p>
162
163  <p>An application that can work with any of several OpenGL ES versions should
164only specify the numerically lowest version of OpenGL ES that it requires. (It
165can 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>&lt;uses-permission&gt;</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
192users can see and download only those applications that are compatible with
193their devices. One of the ways Market filters applications is by feature
194compatibility.</p>
195
196<p>To determine an application's feature compatibility with a given user's
197device, the Android Market service compares:</p>
198
199<ul>
200<li>Features required by the application &mdash; an application declares features in
201<code>&lt;uses-feature&gt;</code> elements in its manifest <br/>with...</li>
202<li>Features available on the device, in hardware or software &mdash;
203a 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
207provides a shared set of feature constants that both applications and devices
208use to declare feature requirements and support. The available feature constants
209are listed in the <a href="#features-reference">Features Reference</a> tables at
210the bottom of this document, and in the class documentation for {@link
211android.content.pm.PackageManager}.</p>
212
213<p>When the user launches the Market application, the application queries the
214Package Manager for the list of features available on the device by calling
215{@link android.content.pm.PackageManager#getSystemAvailableFeatures()}. The
216Market application then passes the features list up to the Android Market
217service when establishing the session for the user.</p>
218
219<p>Each time you upload an application to the Android Market Publisher Site,
220Android Market scans the application's manifest file. It looks for
221<code>&lt;uses-feature&gt;</code> elements and evaluates them in combination
222with other elements, in some cases, such as <code>&lt;uses-sdk&gt;</code> and
223<code>&lt;uses-permission&gt;</code> elements. After establishing the
224application's set of required features, it stores that list internally as
225metadata associated with the application <code>.apk</code> and the application
226version. </p>
227
228<p>When a user searches or browses for applications using the Android Market
229application, the service compares the features needed by each application with
230the features available on the user's device. If all of an application's required
231features are present on the device, Android Market allows the user to see the
232application and potentially download it. If any required feature is not
233supported by the device, Android Market filters the application so that it is
234not visible to the user and not available for download. </p>
235
236<p>Because the features you declare in <code>&lt;uses-feature&gt;</code>
237elements directly affect how Android Market filters your application, it's
238important to understand how Android Market evaluates the application's manifest
239and establishes the set of required features. The sections below provide more
240information. </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>&lt;uses-feature&gt;</code> element. The feature declaration can include
246an <code>android:required=["true" | "false"]</code> attribute (if you are
247compiling against API level 5 or higher), which lets you specify whether the
248application absolutely requires the feature and cannot function properly without
249it (<code>"true"</code>), or whether the application prefers to use the feature
250if 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
256the feature to the list of required features for the application. It then
257filters the application from users on devices that do not provide that feature.
258For example:
259<pre>&lt;uses-feature android:name="android.hardware.camera" android:required="true" /&gt;</pre></li>
260<li>If a feature is explicitly declared as <em>not</em> being required, Android
261Market <em>does not</em> add the feature to the list of required features. For
262that reason, an explicity declared non-required feature is never considered when
263filtering the application. Even if the device does not provide the declared
264feature, Android Market will still consider the application compatible with the
265device and will show it to the user, unless other filtering rules apply. For
266example:
267<pre>&lt;uses-feature android:name="android.hardware.camera" android:required="false" /&gt;</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
270is 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
274versions, the <code>android:required</code> attribute is not available in the
275API and Android Market assumes that any and all
276<code>&lt;uses-feature&gt;</code> declarations are required. </p>
277
278<p class="note"><strong>Note:</strong> By declaring a feature explicitly and
279including an <code>android:required="false"</code> attribute, you can
280effectively 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
287function properly, but which is <em>not</em> declared in a
288<code>&lt;uses-feature&gt;</code> element in the manifest file. Strictly
289speaking, every application should <em>always</em> declare all features that it
290uses or requires, so the absence of a declaration for a feature used by an
291application should be considered an error. However, as a safeguard for users and
292developers, Android Market looks for implicit features in each application and
293sets up filters for those features, just as it would do for an explicitly
294declared 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>&lt;uses-feature&gt;</code> element was
301not available.</li>
302<li>The developer incorrectly assumed that the feature would be present on all
303devices 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
306valid. For example, a spelling error in the <code>&lt;uses-feature&gt;</code>
307element 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
313application's implied feature requirements by examining <em>other elements</em>
314declared in the manifest file, specifically,
315<code>&lt;uses-permission&gt;</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
319therefore requires those features</em>, even though there might be no
320corresponding to <code>&lt;uses-feature&gt;</code> declarations. For such
321permissions, Android Market adds the underlying hardware features to the
322metadata 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
325but does not declare a <code>&lt;uses-feature&gt;</code> element for
326<code>android.hardware.camera</code>, Android Market considers that the
327application requires a camera and should not be shown to users whose devices do
328not offer a camera.</p>
329
330<p>If you don't want Android Market to filter based on a specific implied
331feature, you can disable that behavior. To do so, declare the feature explicitly
332in a <code>&lt;uses-feature&gt;</code> element and include an 
333<code>android:required="false"</code> attribute. For example, to disable
334filtering derived from the <code>CAMERA</code> permission, you would declare
335the feature as shown below.</p>
336
337<pre>&lt;uses-feature android:name="android.hardware.camera" android:required="false" /&gt;</pre>
338
339<p class="caution">It's important to understand that the permissions that you
340request in <code>&lt;uses-permission&gt;</code> elements can directly affect how
341Android Market filters your application. The reference section <a
342href="permissions-features">Permissions that Imply Feature Requirements</a>,
343below, lists the full set of permissions that imply feature requirements and
344therefore 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
349determining filtering for Bluetooth.</p>
350
351<p>If an application declares a Bluetooth permission in a
352<code>&lt;uses-permission&gt;</code> element, but does not explicitly declare
353the Bluetooth feature in a <code>&lt;uses-feature&gt;</code> element, Android
354Market checks the version(s) of the Android platform on which the application is
355designed to run, as specified in the <code>&lt;uses-sdk&gt;</code> element. </p>
356
357<p>As shown in the table below, Android Market enables filtering for the
358Bluetooth feature only if the application declares its lowest or targeted
359platform as Android 2.0 (API level 5) or higher. However, note that Android
360market applies the normal rules for filtering when the application explicitly
361declares the Bluetooth feature in a <code>&lt;uses-feature&gt;</code> element.
362</p>
363
364<p class="caption"><strong>Table 1.</strong> How Android Market determines the
365Bluetooth feature requirement for an application that requests a Bluetooth
366permission but does not declare the Bluetooth feature in a
367<code>&lt;uses-feature&gt;</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>&lt;=4 (or uses-sdk is not declared)</nobr></td>
377<td>&lt;=4</td>
378<td>Android Market <em>will not</em> filter the application from any devices
379based on their reported support for the <code>android.hardware.bluetooth</code>
380feature.</td>
381</tr>
382<tr>
383<td>&lt;=4</td>
384<td>&gt;=5</td>
385<td rowspan="2">Android Market filters the application from any devices that
386do not support the <code>android.hardware.bluetooth</code> feature (including
387older releases).</td>
388</tr>
389<tr>
390<td>&gt;=5</td>
391<td>&gt;=5</td>
392</tr>
393</table>
394
395<p>The examples below illustrate the different filtering effects, based on how
396Android 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
400declares a Bluetooth permission, but does not declare the Bluetooth feature in a
401<code>&lt;uses-feature&gt;</code> element.</dt>
402<dd><em>Result:</em> Android Market does not filter the application from any device.</dd>
403</dl>
404
405<pre>&lt;manifest ...>
406...
407    &lt;uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
408    &lt;uses-sdk android:minSdkVersion="3" />
409...
410&lt;/manifest></pre>
411
412<dl>
413<dt>In the second example, below, the same application also declares a target
414API level of "5". </dt>
415<dd><em>Result:</em> Android Market now assumes that the feature is required and
416will filter the application from all devices that do not report Bluetooth support,
417including devices running older versions of the platform. </dd>
418</dl>
419
420<pre>&lt;manifest ...>
421...
422    &lt;uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
423    &lt;uses-sdk android:minSdkVersion="3" android:targetSdkVersion="5" />
424...
425&lt;/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>&lt;manifest ...>
433...
434    &lt;uses-feature android:name="android.hardware.bluetooth" />
435    &lt;uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
436    &lt;uses-sdk android:minSdkVersion="3" android:targetSdkVersion="5" />
437...
438&lt;/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
444feature support, for all devices.</dd>
445</dl>
446
447<pre>&lt;manifest ...>
448...
449    &lt;uses-feature android:name="android.hardware.bluetooth" android:required="false" />
450    &lt;uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
451    &lt;uses-sdk android:minSdkVersion="3" android:targetSdkVersion="5" />
452...
453&lt;/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
460determine how Android Market will filter your application, based on its declared
461features and permissions. To do so, run  <code>aapt</code> with the <code>dump
462badging</code> command. This causes <code>aapt</code> to parse your
463application's manifest and apply the same rules as used by Android Market to
464determine 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>.
470If you are developing in Eclipse with ADT, right-click the project and select
471<strong>Android Tools</strong> &gt; <strong>Export Unsigned Application
472Package</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.
475If you are using SDK Tools r7 or earlier, you can find <code>aapt</code> in the
476<code>&lt;<em>SDK</em>&gt;/platforms/android-&lt;<em>platform</em>&gt;/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 release available. If
479you do not have the latest platform release, download it using the <a
480href="{@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 &lt;<em>path_to_exported_.apk</em>&gt;</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
490package: name='com.example.android.btexample' versionCode='' versionName=''
491<strong>uses-permission:'android.permission.BLUETOOTH_ADMIN'</strong>
492<strong>uses-feature:'android.hardware.bluetooth'</strong>
493sdkVersion:'3'
494targetSdkVersion:'5'
495application: label='BT Example' icon='res/drawable/app_bt_ex.png'
496launchable activity name='com.example.android.btexample.MyActivity'label='' icon=''
497uses-feature:'android.hardware.touchscreen'
498main
499supports-screens: 'small' 'normal' 'large'
500locales: '--_--'
501densities: '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
508features 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
513most current platform release. To signal that your application uses or requires
514a hardware feature, declare each value in a <code>android:name</code> attribute
515in a separate <code>&lt;uses-feature&gt;</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>Bluetooth</td>
526       <td><code>android.hardware.bluetooth</td>
527       <td>The application uses Bluetooth radio features in the device.</td>
528<td>
529</td>
530    </tr>
531    <tr>
532       <td rowspan="3">Camera</td>
533       <td><code>android.hardware.camera</code></td>
534       <td>The application uses the device's camera. If the device supports
535           multiple cameras, the application uses the camera that facing
536           away from the screen.</td>
537       <td></td>
538    </tr>
539<tr>
540  <td><code>android.hardware.camera.autofocus</code></td>
541  <td>Subfeature. The application uses the device camera's autofocus capability.</td>
542  <td rowspan="2">If declared with the <code>"android:required="true"</code>
543attribute, these subfeatures implicitly declare the
544<code>android.hardware.camera</code> parent feature. </td>
545</tr>
546<tr>
547  <td><code>android.hardware.camera.flash</code></td>
548  <td>Subfeature. The application uses the device camera's flash.</td>
549</tr>
550
551<tr>
552  <td rowspan="3">Location</td>
553  <td><code>android.hardware.location</code></td>
554  <td>The application uses one or more features on the device for determining
555location, such as GPS location, network location, or cell location.</td>
556  <td></td>
557</tr>
558<tr>
559  <td><code>android.hardware.location.network</code></td>
560  <td>Subfeature. The application uses coarse location coordinates obtained from
561a network-based geolocation system supported on the device.</td>
562  <td rowspan="2">If declared with the <code>"android:required="true"</code>
563attribute, these subfeatures implicitly declare the
564<code>android.hardware.location</code> parent feature. </td>
565</tr>
566<tr>
567  <td><code>android.hardware.location.gps</code></td>
568  <td>Subfeature. The application uses precise location coordinates obtained
569from a Global Positioning System receiver on the device. </td>
570</tr>
571
572<tr>
573  <td rowspan="4">Sensors</td>
574  <td><code>android.hardware.sensor.accelerometer</code></td>
575  <td>The application uses motion readings from an accelerometer on the
576device.</td>
577  <td></td>
578</tr>
579<tr>
580  <td><code>android.hardware.sensor.compass</code></td>
581  <td>The application uses directional readings from a magnetometer (compass) on
582the device.</td>
583  <td></td>
584</tr>
585<tr>
586  <td><code>android.hardware.sensor.light</code></td>
587  <td>The application uses the device's light sensor.</td>
588  <td></td>
589</tr>
590<tr>
591  <td><code>android.hardware.sensor.proximity</code></td>
592  <td>The application uses the device's proximity sensor.</td>
593  <td></td>
594</tr>
595<tr>
596  <td>Microphone</td>
597  <td><code>android.hardware.microphone</code></td>
598  <td>The application uses a microphone on the device.
599  </td>
600  <td></td>
601</tr>
602
603<tr>
604  <td rowspan="3">Telephony</td>
605  <td><code>android.hardware.telephony</code></td>
606  <td>The application uses telephony features on the device, such as telephony
607radio with data communication services.</td>
608  <td></td>
609</tr>
610<tr>
611  <td><code>android.hardware.telephony.cdma</code></td>
612  <td>Subfeature. The application uses CDMA telephony radio features on the
613device. </td>
614  <td rowspan="2">If declared with the <code>"android:required="true"</code>
615attribute, these subfeatures implicitly declare the
616<code>android.hardware.telephony</code> parent feature. </td>
617</tr>
618<tr>
619  <td><code>android.hardware.telephony.gsm</code></td>
620  <td>Subfeature. The application uses GSM telephony radio features on the
621device.</td>
622</tr>
623
624<tr>
625  <td rowspan="3">Touchscreen</td>
626  <td><code>android.hardware.touchscreen</code></td>
627  <td>The application uses touchscreen capabilities on the device.</td>
628  <td></td>
629</tr>
630<tr>
631  <td><code>android.hardware.touchscreen.multitouch</code></td>
632  <td>The application uses basic two-point multitouch capabilities on the device
633screen.</td>
634  <td>If declared with the <code>"android:required="true"</code> attribute, this
635subfeature implicitly declares the <code>android.hardware.touchscreen</code>
636parent feature. </td>
637</tr>
638<tr>
639  <td><code>android.hardware.touchscreen.multitouch.distinct</code></td>
640  <td>Subfeature. The application uses advanced multipoint multitouch
641capabilities on the device screen, such as for tracking two or more points fully
642independently.</td>
643  <td>If declared with the <code>"android:required="true"</code> attribute, this
644subfeature implicitly declares the
645<code>android.hardware.touchscreen.multitouch</code> parent feature. </td>
646</tr>
647
648<tr>
649  <td>Wifi</td>
650  <td><code>android.hardware.wifi</code></td>
651  <td>The application uses 802.11 networking (wifi) features on the device.</td>
652  <td></td>
653</tr>
654
655  </table>
656
657<h3 id="sw-features">Software features</h3>
658
659<p>The table below describes the software feature descriptors supported by the
660most current platform release. To signal that your application uses or requires
661a software feature, declare each value in a <code>android:name</code> attribute
662in a separate <code>&lt;uses-feature&gt;</code> element. </p>
663
664
665  <table>
666    <tr> 
667       <th>Feature</th>
668       <th>Attribute Value</th> 
669       <th>Description</th>
670    </tr>
671    <tr>
672      <td>Live Wallpaper</td>
673      <td><code>android.software.live_wallpaper</code></td>
674      <td>The application uses or provides Live Wallpapers.
675      </td>
676    </tr>
677  </table>
678
679
680<h3 id="permissions">Permissions that Imply Feature Requirements</h3>
681
682<p>Some feature constants listed in the tables above were made available to
683applications <em>after</em> the corresponding API; for example, the
684<code>android.hardware.bluetooth</code> feature was added in Android 2.2 (API
685level 8), but the bluetooth API that it refers to was added in Android 2.0 (API
686level 5). Because of this, some apps were able to use the API before they had
687the ability to declare that they require the API via the
688<code>&lt;uses-feature&gt;</code> system. </p>
689
690<p>To prevent those apps from being made available unintentionally,  Android
691Market assumes that certain hardware-related permissions indicate that the
692underlying hardware features are required by default. For instance, applications
693that use Bluetooth must request the <code>BLUETOOTH</code> permission in a
694<code>&lt;uses-permission&gt;</code> element &mdash; for legacy apps, Android
695Market assumes that the permission declaration means that the underlying
696<code>android.hardware.bluetooth</code> feature is required by the application
697and sets up filtering based on that feature. </p>
698
699<p>The table below lists permissions that imply feature requirements
700equivalent to those declared in <code>&lt;uses-feature&gt;</code> elements. Note
701that <code>&lt;uses-feature&gt;</code> declarations, including any declared
702<code>android:required</code> attribute, always take precedence over features
703implied by the permissions below. </p>
704
705<p>For any of the permissions below, you can disable filtering based on the
706implied feature by explicitly declaring the implied feature explicitly, in a
707<code>&lt;uses-feature&gt;</code> element, with an
708<code>android:required="false"</code> attribute. For example, to disable any
709filtering based on the <code>CAMERA</code> permission, you would add this
710<code>&lt;uses-feature&gt;</code> declaration to the manifest file:</p>
711
712<pre>&lt;uses-feature android:name="android.hardware.camera" android:required="false" /&gt;</pre>
713
714<table id="permissions-features" >
715  <tr> 
716    <th>Category</th>
717    <th>This Permission...</th>
718    <th>Implies This Feature Requirement</th>
719    <!-- <th>Comments</th> -->
720  </tr>
721
722
723<tr>
724  <td rowspan="2">Bluetooth</td>
725  <td><code>BLUETOOTH</code></td>
726  <td><code>android.hardware.bluetooth</code>
727<p>(See <a href="#bt-permission-handling">Special handling for Bluetooth feature</a> for details.)</p></td>
728<!--  <td></td> -->
729</tr>
730<tr>
731  <td><code>BLUETOOTH_ADMIN</code></td>
732  <td><code>android.hardware.bluetooth</code></td>
733<!--  <td></td> -->
734</tr>
735
736<tr>
737  <td>Camera</td>
738  <td><code>CAMERA</code></td>
739  <td><code>android.hardware.camera</code> <em>and</em>
740<br><code>android.hardware.camera.autofocus</code></td>
741<!--  <td></td> -->
742</tr>
743
744<tr>
745  <td rowspan="5">Location</td>
746  <td><code>ACCESS_MOCK_LOCATION</code></td>
747  <td><code>android.hardware.location</code></td>
748<!--  <td></td> -->
749</tr>
750<tr>
751  <td><code>ACCESS_LOCATION_EXTRA_COMMANDS</code></td>
752  <td><code>android.hardware.location</code></td>
753<!--  <td></td> -->
754</tr>
755<tr>
756  <td><code>INSTALL_LOCATION_PROVIDER</code></td>
757  <td><code>android.hardware.location</code></td>
758<!--  <td></td> -->
759</tr>
760<tr>
761  <td><code>ACCESS_COARSE_LOCATION</code></td>
762  <td><code>android.hardware.location.network</code> <em>and</em>
763<br><code>android.hardware.location</code></td>
764<!--  <td></td> -->
765</tr>
766<tr>
767  <td><code>ACCESS_FINE_LOCATION</code></td>
768  <td><code>android.hardware.location.gps</code> <em>and</em>
769<br><code>android.hardware.location</code></td>
770<!--  <td></td> -->
771</tr>
772
773<tr>
774  <td>Microphone</td>
775  <td><code>RECORD_AUDIO</code></td>
776  <td><code>android.hardware.microphone</code></td>
777<!--  <td></td> -->
778</tr>
779
780<tr>
781  <td rowspan="11">Telephony</td>
782  <td><code>CALL_PHONE</code></td>
783  <td><code>android.hardware.telephony</code></td>
784<!--  <td></td> -->
785</tr>
786<tr>
787  <td><code>CALL_PRIVILEGED</code></td>
788  <td><code>android.hardware.telephony</code></td>
789<!--  <td></td> -->
790</tr>
791
792<tr>
793  <td><code>MODIFY_PHONE_STATE</code></td>
794  <td><code>android.hardware.telephony</code></td>
795<!--  <td></td> -->
796</tr>
797<tr>
798  <td><code>PROCESS_OUTGOING_CALLS</code></td>
799  <td><code>android.hardware.telephony</code></td>
800<!--  <td></td> -->
801</tr>
802<tr>
803  <td><code>READ_SMS</code></td>
804  <td><code>android.hardware.telephony</code></td>
805<!--  <td></td> -->
806</tr>
807<tr>
808  <td><code>RECEIVE_SMS</code></td>
809  <td><code>android.hardware.telephony</code></td>
810<!--  <td></td> -->
811</tr>
812<tr>
813  <td><code>RECEIVE_MMS</code></td>
814  <td><code>android.hardware.telephony</code></td>
815<!--  <td></td> -->
816</tr>
817<tr>
818  <td><code>RECEIVE_WAP_PUSH</code></td>
819  <td><code>android.hardware.telephony</code></td>
820<!--  <td></td> -->
821</tr>
822<tr>
823  <td><code>SEND_SMS</code></td>
824  <td><code>android.hardware.telephony</code></td>
825<!--  <td></td> -->
826</tr>
827<tr>
828  <td><code>WRITE_APN_SETTINGS</code></td>
829  <td><code>android.hardware.telephony</code></td>
830<!--  <td></td> -->
831</tr>
832<tr>
833  <td><code>WRITE_SMS</code></td>
834  <td><code>android.hardware.telephony</code></td>
835<!--  <td></td> -->
836</tr>
837
838<tr>
839  <td rowspan="3">Wifi</td>
840  <td><code>ACCESS_WIFI_STATE</code></td>
841  <td><code>android.hardware.wifi</code></td>
842<!--  <td></td> -->
843</tr>
844<tr>
845  <td><code>CHANGE_WIFI_STATE</code></td>
846  <td><code>android.hardware.wifi</code></td>
847<!--  <td></td> -->
848</tr>
849<tr>
850  <td><code>CHANGE_WIFI_MULTICAST_STATE</code></td>
851  <td><code>android.hardware.wifi</code></td>
852<!--  <td></td> -->
853</tr>
854</table>