The <provider> Element

  Like Activity and Service components, a subclass of ContentProvider must be defined in the manifest file for its application, using the <provider> element.   The Android system gets the following information from the element:

  • Authority (android:authorities)

Symbolic names that identify the entire provider within the system. This attribute is described in more detail in the section Designing Content URIs.

  • Provider class name ( android:name ) 注意:是class name

The class that implements ContentProvider. This class is described in more detail in the section Implementing the ContentProvider Class.

  • Permissions 权限

Attributes that specify the permissions that other applications must have in order to access the provider's data:

    1. android:grantUriPermssions: Temporary permission flag.
    2. android:permission: Single provider-wide read/write permission.
    3. android:readPermission: Provider-wide read permission.
    4. android:writePermission: Provider-wide write permission.

Permissions and their corresponding attributes are described in more detail in the section Implementing Content Provider Permissions.

  • Startup and control attributes 启动属性

These attributes determine how and when the Android system starts the provider, the process characteristics of the provider, and other run-time settings:

    1. android:enabled: Flag allowing the system to start the provider.

      是否随系统启动
    2. android:exported: Flag allowing other applications to use this provider.
    3. android:initOrder: The order in which this provider should be started, relative to other providers in the same process.
      是否初始化
    4. android:multiProcess: Flag allowing the system to start the provider in the same process as the calling client.
      与客户端同进程 
    5. android:process: The name of the process in which the provider should run.
    6. android:syncable: Flag indicating that the provider's data is to be sync'ed with data on a server.

The attributes are fully documented in the dev guide topic for the <provider> element.

    详见 guide/topics/manifest/provider-element.html
  • Informational attributes

    An optional icon and label for the provider:

    1. android:icon: A drawable resource containing an icon for the provider. The icon appears next to the provider's label in the list of apps in Settings > Apps > All.
    2. android:label: An informational label describing the provider or its data, or both. The label appears in the list of apps in Settings > Apps > All.

    The attributes are fully documented in the dev guide topic for the <provider> element.

    详见 guide/topics/manifest/provider-element.html

ContentProvider官方教程(10)<provider>元素及属性介绍的更多相关文章

  1. ContentProvider官方教程(6)provider支持的数据类型

    Provider Data Types Content providers can offer many different data types. The User Dictionary Provi ...

  2. ContentProvider官方教程(9)定义一个provider完整示例:实现方法,定义权限等

    Creating a Content Provider In this document Designing Data Storage Designing Content URIs Implement ...

  3. ContentProvider官方教程(1)何时用content provider

    Content Providers Content providers manage access to a structured set of data. They encapsulate the ...

  4. ContentProvider官方教程(11)Calendar Provider、Contacts Provider、Storage Access Framework

    Calendar Provider: guide/topics/providers/calendar-provider.html Contacts Provider: guide/topics/pro ...

  5. ContentProvider官方教程(7)3种访问形式:批处理、异步访问、intent间接访问(临时URI权限)

    Alternative Forms of Provider Access Three alternative forms of provider access are important in app ...

  6. ContentProvider官方教程(5)ContentResolver插入、更新、删除 示例

    Inserting, Updating, and Deleting Data In the same way that you retrieve data from a provider, you a ...

  7. ContentProvider官方教程(2)简介、Content URIs

    In this document Overview Accessing a provider Content URIs Content Provider Basics A content provid ...

  8. ContentProvider官方教程(8)自定义MIME

    MIME Type Reference Content providers can return standard MIME media types, or custom MIME type stri ...

  9. ContentProvider官方教程(4)ContentResolver权限

    Content Provider Permissions A provider's application can specify permissions that other application ...

随机推荐

  1. android 修改系统的dialog样式

    android 修改系统的dialog样式 一.觉得自定义配置文件麻烦?那就来修改系统自定义XML文件来实现修改系统dialog的样式吧. 如果是在XML中样式:首先来说下样式.  在 Style.x ...

  2. linux下调整音量大小

    不得不说,在linux下整音频和视频真是不容易.在windows中自带了关于音频和视频的工具,在linux下要两眼一抹黑地使用命令进行操作. 主要还是在linux下没找到合适的gui的调整工具. 几番 ...

  3. jquery ui和jquery easy ui的区别

    jquery ui 是jquery开发团队 开发,适用于网站式的页面.jquery easyui 是第三方基于jquery开发,适用于应用程序式的页面. 两者的方法调用也略有不同:jquery ui ...

  4. VS中快速生成json数据格式对应的实体

    JSON是一种取代XML的数据结构,和xml相比,它更小巧但描述能力却不差,由于它的小巧所以网络传输数据将减少更多流量从而加快速度. JSON就是一串字符串 只不过元素会使用特定的符号标注. {} 双 ...

  5. Ubuntu 13.10 64位 无法 安装 ia32-libs 解决办法

    安装新立德软件包管理器:打开终端,输入以下命令:sudo apt-get install synaptic 打开新立德软件包管理器,选择“设置>软件库” 选择“其他软件 > 添加” 在AP ...

  6. java concurrency in practice读书笔记---ThreadLocal原理

    ThreadLocal这个类很强大,用处十分广泛,可以解决多线程之间共享变量问题,那么ThreadLocal的原理是什么样呢?源代码最能说明问题! public class ThreadLocal&l ...

  7. 鸟哥的linux私房菜学习记录之档案与目录管理

    绝对路径和相对路径 绝对路径就是从根目录到某个目录下的路径,从根目录写起,也就是/ 相对路径就是从用户当前目录的路径写起 目录相关操作 cd 切换路径 例如:cd /var/www 切换到/var/w ...

  8. uboot启动参数

    bootcmd=nand read.jffs2 0x30007FC0 kernel; bootm 0x30007FC0bootdelay=2baudrate=115200ethaddr=08:00:3 ...

  9. laravel队列

    三种情况: queue:work 默认只执行一次队列请求, 当请求执行完成后就终止; queue:listen 监听队列请求, 只要运行着, 就能一直接受请求, 除非手动终止; queue:work ...

  10. SendKeys:基本使用

    使用SendKeys将键击和组合键击发送到活动应用程序.此类无法实例化.若要发送一个键击给某个类并立即继续程序流,请使用Send.若要等待键击启动的任何进程,请使用SendWait. 每个键都由一个或 ...