• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1page.title=<uses-permission>
2@jd:body
3
4<dl class="xml">
5
6 <div class="sidebox-wrapper">
7  <img id="rule" src="{@docRoot}assets/images/grad-rule-qv.png">
8  <div id="qv-sub-rule">
9    <img src="{@docRoot}assets/images/icon_market.jpg" style="float:left;margin:0;padding:0;">
10    <p style="color:#669999;"><code style="color:#669999;">&lt;uses-permission&gt;</code> and filtering on Android Market. </p>
11
12<p style="margin-top:1em;">In some cases, the permissions that you request
13through <code>&lt;uses-permission&gt;</code> can affect how
14your application is filtered by Android Market.</p>
15
16<p style="margin-top:1em;">If you request a hardware-related permission &mdash;
17<code>CAMERA</code>, for example &mdash; Android Market assumes that your
18application requires the underlying hardware feature and filters the application
19from devices that do not offer it.</p>
20
21<p style="margin-top:1em;">To control filtering, always explicitly declare
22hardware features in <code>&lt;uses-feature&gt;</code> elements, rather than
23relying on Android Market to "discover" the requirements in
24<code>&lt;uses-permission&gt;</code> elements. Then, if you want to disable
25filtering for a particular feature, you can add a
26<code>android:required="false"</code> attribute to the
27<code>&lt;uses-feature&gt;</code> declaration.</p>
28
29<p style="margin-top:1em;" class="caution">For a list of permissions that imply
30hardware features, see the documentation for the <a
31href="{@docRoot}guide/topics/manifest/uses-feature-element.html#permissions-features">
32<code>&lt;uses-feature&gt;</code></a> element.</p>
33</div>
34</div>
35
36
37<dt>syntax:</dt>
38<dd><pre class="stx">&lt;uses-permission android:<a href="#nm">name</a>="<i>string</i>" /&gt;</pre></dd>
39
40<dt>contained in:</dt>
41<dd><code><a href="{@docRoot}guide/topics/manifest/manifest-element.html">&lt;manifest&gt;</a></code></dd>
42
43<dt>description:</dt>
44<dd>Requests a permission that the application must be granted in
45order for it to operate correctly.  Permissions are granted by the user when the
46application is installed, not while it's running.
47
48<p>
49For more information on permissions, see the
50<a href="{@docRoot}guide/topics/manifest/manifest-intro.html#perms">Permissions</a></code>
51section in the introduction and the separate
52<a href="{@docRoot}guide/topics/security/security.html">Security and Permissions</a> document.
53A list of permissions defined by the base platform can be found at
54{@link android.Manifest.permission android.Manifest.permission}.
55
56<dt>attributes:</dt>
57<dd><dl class="attr">
58<dt><a name="nm"></a>{@code android:name}</dt>
59<dd>The name of the permission.  It can be a permission defined by the
60application with the <code><a href="{@docRoot}guide/topics/manifest/permission-element.html">&lt;permission&gt;</a></code>
61element, a permission defined by another application, or one of the
62standard system permissions, such as "{@code android.permission.CAMERA}"
63or "{@code android.permission.READ_CONTACTS}".  As these examples show,
64a permission name typically includes the package name as a prefix.</dd>
65
66</dl></dd>
67
68<!-- ##api level indication## -->
69<dt>introduced in:</dt>
70<dd>API Level 1</dd>
71
72<dt>see also:</dt>
73<dd>
74<ul>
75  <li><code><a href="{@docRoot}guide/topics/manifest/permission-element.html">&lt;permission&gt;</a></code></li>
76  <li><code><a href="{@docRoot}guide/topics/manifest/uses-feature-element.html">&lt;uses-feature&gt;</a></code></li>
77</ul>
78</dd>
79
80</dl>
81