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. 杭电 1595 find the safest road

    find the safest road Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Ot ...

  2. cannot modify header information 关于实现widget页面跳转的问题

    查找网上解决此问题的方法多是一样的,不过今天又遇到了这样的问题.试过之后发现可行: 在C盘的WINDOWS或者你的PHP文件夹中找到php.ini 这个配置文件,然后查找一项:output_buffe ...

  3. [php] 判断当前运行模式

    //判断是否cgi模式 define('IS_CGI',substr(PHP_SAPI, 0,3)=='cgi' ? 1 : 0 ); //判断操作系统是否为windows define('IS_WI ...

  4. SQL分组取每组前一(或几)条记录(排名)

    mysql分组取每组前几条记录(排名) 附group by与order by的研究 http://www.jb51.net/article/31590.htm --按某一字段分组取最大(小)值所在行的 ...

  5. SQL的主键和外键约束(转)

    SQL的主键和外键的作用: 外键取值规则:空值或参照的主键值. (1)插入非空值时,如果主键表中没有这个值,则不能插入. (2)更新时,不能改为主键表中没有的值. (3)删除主键表记录时,你可以在建外 ...

  6. fix org.openqa.selenium.NoSuchWindowException when find element on ie11.

    Steps:1.I was able to resolve the issue after adding the site URL under trusted sites of IE. The sam ...

  7. javaWeb---Servlet

    1.整个Servlet页面跳转访问流程: 1.1:依据form表单的action的值找到web.xml中servlet-mapping的url的值找到对应的java类,在根据form中的method属 ...

  8. MySQL5.5半同步模式

    MySQL5.5支持半同步的复制模式,什么是半同步的? 1. MySQL5.5之前的Master-SLave的复制模式是异步的,这里的文档有详细的说明;

  9. html5+php实现文件的断点续传ajax异步上传

    html5+php实现文件的断点续传ajax异步上传 准备知识:断点续传,既然有断,那就应该有文件分割的过程,一段一段的传.以前文件无法分割,但随着HTML5新特性的引入,类似普通字符串.数组的分割, ...

  10. [转]How Can I Find Out What Is Using a Busy or Reserved Serial Port?

    转自:http://digital.ni.com/public.nsf/allkb/29B079481C5ECE76862578810082394E How Can I Find Out What I ...