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. 关于C# winform 快速制作不规则边框的方法

    今天逛博客园突然发现一个帖子写的   快速建立不规则边框的方式 突然发现以前自己用API的方式好傻… 杀鸡焉用牛刀  下边是从网上不断转载的 原帖: 地址:http://www.cnblogs.com ...

  2. LDA-math-文本建模

    http://cos.name/2013/03/lda-math-text-modeling/ 4. 文本建模 我们日常生活中总是产生大量的文本,如果每一个文本存储为一篇文档,那每篇文档从人的观察来说 ...

  3. ThinkPHP讲解(二)控制器

    在这一节,具体讲解控制器,以Jiaowu应用目录为例. 1.如何写控制器,如何写操作方法? 在模块控制器目录Controller下新建一个控制器文件MainController.class.php,写 ...

  4. javaWeb 在jsp中 使用自定义标签输出访问者IP

    1.java类,使用简单标签,jsp2.0规范, 继承 SimpleTagSupport public class ViewIpSimpleTag extends SimpleTagSupport { ...

  5. android 中 listview 设置自动匹配高度

    1.布局文件 <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:l ...

  6. linux下共享内存mmap和DMA(直接访问内存)的使用 【转】

    转自:http://blog.chinaunix.net/uid-7374279-id-4413316.html 介绍Linux内存管理和内存映射的奥秘.同时讲述设备驱动程序是如何使用“直接内存访问” ...

  7. oracle 数据泵 每天自动备份

    @echo off echo 删除10天前的备分文件和日志 forfiles /p "e:\app\back" /m *.dmp /d -5 /c "cmd /c del ...

  8. Java中的线程同步机制

    一.首先为什么线程需要同步? 1.多线程安全问题的原因      A:有多线程环境      B:有共享数据      C:有多条语句操作共享数据 2. //未完待续后面会继续更新

  9. 安装新版xampp后apache无法启动提示:Apache Service detected with wrong path解决方案

    我以前安装过xampp,因为学习thingPHP需要升级PHP5.0以上,所以我就卸掉了xampp,从新安装新版本的xampp其中PHP是最新版的,但是安装后启动xampp提示如下:Apache Se ...

  10. rsync 排除指定目录或文件进行同步

    很常见的情况:我想同步/myweb下的 一些php文件 ,  但是不想复制/myweb/log/里边的一些日志文件,因为这些文件太大了,备份也是没有意义的. 现在如果想避开某个路径  直接添加—exc ...