<uses-library>

英文原文:http://developer.android.com/guide/topics/manifest/uses-library-element.html
采集(更新)日期:2014-7-10
搬迁自原博客:http://blog.sina.com.cn/s/blog_48d491300100zmwz.html

Google Play 过滤机制

Google Play 利用 Manifest 文件中声明的 <uses-library> 元素进行过滤,
使得无法满足应用程序对链接库需求的设备就无法安装该应用程序。
关于过滤机制的详细信息,请参阅文章Google Play 过滤器

语法:
<uses-library
android:name="string"
android:required=["true" | "false"] />
包含于:
<application>
说明:
定义应用程序必须链接的公共库。 本元素把程序包的类装载器中需要包含的库代码通知系统。

所有的 android 包(比如 android.appandroid.contentandroid.viewandroid.widget )都包含在默认库中,所有的应用程序都会自动进行链接。 不过有些包(比如 maps)位于单独的库中,他们不会被自动链接进来。 请参阅所用包的文档,以确定其代码包含于哪个库中。

本元素还会影响应用程序在某些设备上的安装,以及在 Google Play 上的可用性:

安装
如果给出了本元素,并且其 android:required 属性设为 truePackageManager 系统将只允许在提供本库的设备上安装该应用程序。

android:required 属性将在后续章节详细说明。

属性:
android:name
库的名称。该名称在所用包的文档中给出。 例如,“android.test.runner”是包含了 Android 测试类的包。
android:required
布尔值,指明应用程序是否必需由 android:name 指定的库:

  • "true":缺少此库的话,应用程序就无法正常运行。系统将不允许应用程序在不提供此库的设备上安装。
  • "false":库存在的话,应用程序就会使用,但它设计时是考虑缺少此库也能正常工作的。 即使此库不存在,系统也允许安装应用程序。 如果用了“false”,那就必须在运行时检查此库是否可用。

    为了检查库的存在性,可以用反射来确定某个类是否可用。

默认值是“true”。

引入自 API 级别 7 。

引入自:
API 级别 1
参阅:

Android开发-API指南-<uses-library>的更多相关文章

  1. Android开发-API指南-<permission>

    <permission> 英文原文:http://developer.android.com/guide/topics/manifest/permission-element.html 采 ...

  2. Android开发-API指南-<provider>

    <provider> 英文原文:http://developer.android.com/guide/topics/manifest/provider-element.html 采集(更新 ...

  3. Android开发-API指南-应用程序开发基础

    Application Fundamentals 英文原文:http://developer.android.com/guide/components/fundamentals.html 采集(更新) ...

  4. Android开发-API指南-Intent和Intent过滤器

    Intents and Intent Filters 英文原文:http://developer.android.com/guide/components/intents-filters.html 采 ...

  5. Android开发-API指南-Android简介

    Introduction to Android 英文原文:http://developer.android.com/intl/zh-cn/guide/index.html 采集日期:2014-4-16 ...

  6. Android开发-API指南-设备兼容性

    Device Compatibility 英文原文:http://developer.android.com/guide/practices/compatibility.html 采集日期:2014- ...

  7. Android开发-API指南-任务和回退栈

    Task and Back Stack 英文原文: http://developer.android.com/guide/components/tasks-and-back-stack.html 采集 ...

  8. 【最后一篇API译文】Android开发-API指南- Contacts Provider

    Contacts Provider 今年加入了某字幕组,加之杂事颇多,许久未添新文了,惭愧之极. 在听闻 Google 即将重返中国后,近日忽又发现官方网站正在放出 API 中文版,比如本文.当然不是 ...

  9. Android开发-API指南-创建 Content Provider

    Creating a Content Provider 英文原文:http://developer.android.com/guide/topics/providers/content-provide ...

  10. Android开发-API指南-Content Provider基础

    Content Provider Basics 英文原文:http://developer.android.com/guide/topics/providers/content-provider-ba ...

随机推荐

  1. js之浏览器对象模型(BOM)

    一.BOM的层次结构: window(可以访问BOM中的所有元素,是最顶层的元素)下一层包括如下: →document (document的属性:forms.cookie.links/anchors. ...

  2. wcf stream 不知道长度的情况下,读取stream

    http://bbs.csdn.net/topics/360163784 string filepath = @"http://ww4.sinaimg.cn/thumbnail/6741e0 ...

  3. IIS SMTP status codes

    Here are the meaning of SMTP status codes. Status Code Description 211 System status, or system help ...

  4. CSS3字体图标

    网址:http://icomoon.io/http://iconfont.cn/  阿里巴巴字体库 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1 ...

  5. windows7修改双系统启动项名称、先后顺序、等待时间

    一.进入BCDEdit.exe  正常启动Windows 7 系统,点击“开始” -> “所有程序” -> “附件”,右击“命令提示符” -> “以管理员身份运行”(需要将操作当前用 ...

  6. shell下root用户切换其他用户运行程序

    工作中,一些程序,需要随机启动,但是不是以root用户运行,于是需要在rc.local中通过shell,从root用户切换到其他用户运行程序,命令如下: su -c 'command' - user ...

  7. 在Visual Studio 2010/2012中 找不到创建WebService的项目模板

    参考文章: http://blog.sina.com.cn/s/blog_6d545999010152wb.html 在 Visual Studio 2010 或者2012的新建 Web 应用程序或者 ...

  8. Spring配置xml文件详解

    <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.sp ...

  9. Condition的优点

    那么引入本篇的主角,Condition,Condition 将 Object 监视器方法(wait.notify 和 notifyAll)分解成截然不同的对象,以便通过将这些对象与任意 Lock 实现 ...

  10. BigDecimal的equals

    BigDecimal testA = new BigDecimal(79); BigDecimal testB = new BigDecimal("79.00"); System. ...