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. React-Native坑1:Invariant Violation:Application 项目名 has not been registered.

    React-Native坑1:Invariant Violation:Application 项目名 has not been registered. 字数347 阅读1421 评论3 喜欢7 前言 ...

  2. Android 仿土巴兔选择效果

    1,前两天在群里看到有人在讨论土巴兔的选择装修风格的效果,自己也想实现,果断百度一下,有些好的文章,就花了些时间来分析了下,先看看别人土巴兔原装的功能 2,可以看到,基本上可以使用一个vviewpag ...

  3. Sqlserver列出所有数据库名,表名,字段名

    Sqlserver列出所有数据库名,表名,字段名   1.获取所有数据库名:   ? 1 SELECT Name FROM Master..SysDatabases ORDER BY Name   注 ...

  4. 移动widget开发

    发现Oracle----php连接有很多bug无法解决,只好转向php--连接mysql数据库,并装载了mysql两个文件,跟客户端NAVICAT_FOR_MYSQL,然后直接建表,用于测试,能够连通 ...

  5. Beta—review阶段成员贡献分

    小组名称:nice! 小组成员:李权 于淼 刘芳芳 韩媛媛 宫丽君 项目内容:约跑app 分数分配规则 个人贡献分=项目基础分*0.5+个人表现分*0.5 基本贡献分 个人表现分 个人总分 于淼 2. ...

  6. 《zw版·delphi与halcon系列原创教程》zw版_THImagex控件函数列表

    <zw版·delphi与halcon系列原创教程>zw版_THImagex控件函数列表 Halcon虽然庞大,光HALCONXLib_TLB.pas文件,源码就要7w多行,但核心控件就是两 ...

  7. C++中关于无法解析的外部符号问题LNK2019问题的总结

           网上一般有很全面的解决方法,最近恰好本道长也遇到了这种问题,也恰好解决了,这种问题应该算作配置问题,而非程序本身问题,多数是因为接手了生疏的程序导致,此问题看上去很简单,但木有经验的话很 ...

  8. 五、Java基础---------if else、switch总结

    在前几篇博客中主要是以笔者遇到的一些典型的题目为例子而展开的讨论,接下来几篇将是以知识点的结构进行讲述.本文主要是讲述if ()else .if() else if().switch() case 的 ...

  9. OpenStack 界面开发中的排序问题

    Contents [hide] 1 需求 2 调研 3 排序的办法 4 解决代码 需求 获取主机列表的时候,希望能够对主机列表能分组显示,比如网络,一组网络段希望在一起显示 调研 openstack的 ...

  10. netsh修改IP及DNS

    netsh interface ip show addresses  显示当前IP netsh interface ip show dns           显示当前DNS netsh interf ...