Android Development-api Guide-<uses-library>

Source: Internet
Author: User

<uses-library>

English Original: http://developer.android.com/guide/topics/manifest/uses-library-element.html
Acquisition (update) Date: 2014-7-10
Moved from the original blog: http://blog.sina.com.cn/s/blog_48d491300100zmwz.html


Google Play filtering mechanism

Google Play uses the <uses-library> elements declared in the Manifest file to allow devices that cannot meet the requirements of the application to link libraries to install the application. For more information about filtering mechanisms, see the article Google Play filter

Grammar:
< uses-library    Android:name = "string"    android:required />
Included in:
<application>
Description
Defines the public libraries that the application must link to. This element notifies the system of the library code that needs to be included in the package's class loader.

All android packages (such as,,, and android.app android.content android.view android.widget ) are included in the default library, and all applications are automatically linked. However, some packages (for example maps ) are located in separate libraries, and they are not automatically linked in. See the documentation for the package you are using to determine which library its code is contained in.

This element also affects the installation of applications on certain devices, as well as usability on Google Play:

Installation
If this element is given and its properties are android:required set true , PackageManager the system will only allow the application to be installed on the device that provided the library.

android:requiredThe properties are described in detail in subsequent chapters.

Property:
android:name
The name of the library. The name is given in the document of the package being used. For example, " android.test.runner " is a package that contains the Android test class.
android:required
A Boolean value that indicates whether the application is required by android:name the specified library:
  • "true": The application will not function properly if this library is missing. The system will not allow applications to be installed on devices that do not provide this library.
  • "false": The application is used when the library is present, but it is designed to work without this library. The system allows applications to be installed even if the library does not exist. If "" is used false , you must check that the library is available at run time.

    To check the existence of a library, you can use reflection to determine whether a class is available.

The default value is " true ".

Introduced from API level 7.

Introduced from:
API Level 1
See:
  • PackageManager

Android Development-api Guide-<uses-library>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.