DOC CHANGE: Bug 3396898 add attribute uses-library
Change-Id: I21810676050abed04c0c69b61c05d8d7228f434d
This commit is contained in:
@@ -3,34 +3,101 @@ page.title=<uses-library>
|
|||||||
|
|
||||||
<dl class="xml">
|
<dl class="xml">
|
||||||
<dt>syntax:</dt>
|
<dt>syntax:</dt>
|
||||||
<dd><pre><uses-library android:<a href="#nm">name</a>="<i>string</i>" /></pre></dd>
|
<dd>
|
||||||
|
<pre class="stx">
|
||||||
|
<uses-library android:<a href="#nm">name</a>="<var>string</var>"
|
||||||
|
android:<a href="#rq">required</a>=["true" | "false"] />
|
||||||
|
</pre>
|
||||||
|
</dd>
|
||||||
<dt>contained in:</dt>
|
<dt>contained in:</dt>
|
||||||
<dd><code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code></dd>
|
<dd>
|
||||||
|
<code>
|
||||||
|
<a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a>
|
||||||
|
</code>
|
||||||
|
</dd>
|
||||||
<dt>description:</dt>
|
<dt>description:</dt>
|
||||||
<dd>Specifies a shared library that the application must be linked against.
|
<dd>
|
||||||
This element tells the system to include the library's code in the class
|
Specifies a shared library that the application must be linked against.
|
||||||
loader for the package.
|
This element tells the system to include the library's code in the class
|
||||||
|
loader for the package.
|
||||||
<p>
|
<p>
|
||||||
All of the {@code android} packages (such as {@link android.app},
|
All of the {@code android} packages (such as {@link android.app},
|
||||||
{@link android.content}, {@link android.view}, and {@link android.widget})
|
{@link android.content}, {@link android.view}, and {@link android.widget})
|
||||||
are in the default library that all applications are automatically linked
|
are in the default library that all applications are automatically linked
|
||||||
against. However, some packages (such as {@code maps} and {@code awt} are
|
against. However, some packages (such as {@code maps}) are
|
||||||
in separate libraries that are not automatically linked. Consult the
|
in separate libraries that are not automatically linked. Consult the
|
||||||
documentation for the packages you're using to determine which library
|
documentation for the packages you're using to determine which library
|
||||||
contains the package code.
|
contains the package code.
|
||||||
</p></dd>
|
</p>
|
||||||
|
<p>
|
||||||
|
This element also affects the installation of the application on a particular device and
|
||||||
|
the availability of the application in Android Market:
|
||||||
|
</p>
|
||||||
|
<dl>
|
||||||
|
<dt><em>Installation</em></dt>
|
||||||
|
<dd>
|
||||||
|
If this element is present and its {@code android:required} attribute is set to
|
||||||
|
{@code true}, the {@link android.content.pm.PackageManager} framework won't let the user
|
||||||
|
install the application unless the library is present on the user's device.
|
||||||
|
</dd>
|
||||||
|
<dt><em>Market</em></dt>
|
||||||
|
<dd>
|
||||||
|
Android Market filters applications based on the libraries installed on the
|
||||||
|
user's device. For more information about filtering, see the topic
|
||||||
|
<a href="{@docRoot}/guide/appendix/market-filters.html">Market Filters</a>.
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<p>
|
||||||
|
The {@code android:required} attribute is described in detail in the following section.
|
||||||
|
</p>
|
||||||
|
</dd>
|
||||||
<dt>attributes:</dt>
|
<dt>attributes:</dt>
|
||||||
<dd><dl class="attr">
|
<dd>
|
||||||
<dt><a name="nm"></a>{@code android:name}</dt>
|
<dl class="attr">
|
||||||
<dd>The name of the library.</dd>
|
<dt><a name="nm"></a>{@code android:name}</dt>
|
||||||
</dl></dd>
|
<dd>
|
||||||
|
The name of the library. The name is provided by the
|
||||||
|
documentation for the package you are using. An example of this is
|
||||||
|
"<code>android.test.runner</code>", a package that contains Android test
|
||||||
|
classes.
|
||||||
|
</dd>
|
||||||
|
<dt><a name="rq"></a>{@code android:required}</dt>
|
||||||
|
<dd>
|
||||||
|
Boolean value that indicates whether the application requires the
|
||||||
|
library specified by {@code android:name}:
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<code>"true"</code>: The application does not function without this
|
||||||
|
library. The system will not allow the application on a device that does not
|
||||||
|
have the library.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<code>"false"</code>: The application can use the
|
||||||
|
library if present, but is designed to function without it if necessary.
|
||||||
|
The system will allow the application to be installed, even if the library is
|
||||||
|
not present. If you use <code>"false"</code>, you are responsible for
|
||||||
|
checking at runtime that the library is available.
|
||||||
|
<p>
|
||||||
|
To check for a library, you can use reflection to determine
|
||||||
|
if a particular class is available.
|
||||||
|
</p>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<p>
|
||||||
|
The default is <code>"true"</code>.
|
||||||
|
</p>
|
||||||
|
<p>Introduced in: API Level 7.</p>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</dd>
|
||||||
<!-- ##api level indication## -->
|
<!-- ##api level indication## -->
|
||||||
<dt>introduced in:</dt>
|
<dt>introduced in:</dt>
|
||||||
<dd>API Level 1</dd>
|
<dd>API Level 1</dd>
|
||||||
|
|
||||||
</dl>
|
<dt>see also:</dt>
|
||||||
|
<dd>
|
||||||
|
<ul>
|
||||||
|
<li>{@link android.content.pm.PackageManager}</li>
|
||||||
|
</ul>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
Reference in New Issue
Block a user