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