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. MVC4中下拉菜单和单选框的简单设计方法

    举例一: @Html.LabelFor(model => model.Gender) @Html.DropDownListFor(model => model.Gender, new[] ...

  2. JAVA中extends 与implements区别

    JAVA中extends 与implements有啥区别?1. 在类的声明中,通过关键字extends来创建一个类的子类.一个类通过关键字implements声明自己使用一个或者多个接口.extend ...

  3. CSS(Cascading Style Sheet,叠层样式表),作用是美化HTML网页。

    CSS(Cascading Style Sheet,叠层样式表),作用是美化HTML网页. /*注释区域*/    此为注释语法 一.样式表 (一)样式表的分类 1.内联样式表 和HTML联合显示,控 ...

  4. co css规范

    CSS 编码规范 1. 文件组织 (建议试试LESS) 1.1 CSS 与 HTML CSS 一律写在 CSS 文件中,原则上不写内联样式. CSS 文件命名由小写字母.下划线(_)组成. CSS 文 ...

  5. Delphi中如何将 Exe 程序或其他资料打包在内,使用时再释放使用(转)

    1.生成一个rc文件,文件格式如下: rname exefile "test.exe" //rname是资源名称 //exefile是资源类型 //text.exe是资源 资源类型 ...

  6. flex 右键连接

    var menuItem:ContextMenuItem = new ContextMenuItem("技术支持:中科天宇软件有限公司", true, true); menuIte ...

  7. 中颖4位MCU的减法汇编指令

    1, SUB M 执行动作: M - A -> A, 如果M-A的过程中没有产生借位,则CY= 1,如果产生了借位,则CY= 0. 其中,A为累加器. 2, SBI M, I 执行动作:M - ...

  8. 7.1SportsStore:Navigation and Checkout

    准备示例项目 使用真实的产品数据 现在,要切换到使用真实的数据,从Deployd服务器获取. AngularJS通过一个叫做$http的服务,为Ajax请求提供支持.作者将在第三部分详细讲解它是怎么工 ...

  9. 在 VirtualBox 中 CentOS 网络设置

    转自:本文发表于水景一页.永久链接:<http://cnzhx.net/blog/minimal-centos-in-virtualbox/>.转载请保留此信息及相应链接. 4. 设置¶ ...

  10. PHP多表取数据的代码优化

    <?php header("Content-type: text/html; charset=utf-8"); //假设这里的$goods_arr  和 $shop_arr  ...