Content Providers

  Content providers manage access to a structured set of data. They encapsulate the data, and provide mechanisms for defining data security. Content providers are the standard interface that connects data in one process with code running in another process.

  When you want to access data in a content provider, you use the ContentResolver object in your application's Context to communicate with the provider as a client. The ContentResolver object communicates with the provider object, an instance of a class that implements ContentProvider. The provider object receives data requests from clients, performs the requested action, and returns the results.

  You don't need to develop your own provider if you don't intend to share your data with other applications. However, you do need your own provider to provide custom search suggestions in your own application. You also need your own provider if you want to copy and paste complex data or files from your application to other applications.

  通常需要在不同应用间共享一些数据(图片,音频,联系人等)时.才用Content Provider

  Android itself includes content providers that manage data such as audio, video, images, and personal contact information. You can see some of them listed in the reference documentation for the android.provider package. With some restrictions, these providers are accessible to any Android application.

  android系统内的图片,音频,联系人就是用Content Provider提供的。

ContentProvider官方教程(1)何时用content provider的更多相关文章

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

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

  2. ContentProvider官方教程(10)<provider>元素及属性介绍

    The <provider> Element Like Activity and Service components, a subclass of ContentProvider mus ...

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

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

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

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

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

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

  6. ContentProvider官方教程(3)ContentResolver查询、遍历 示例

    Retrieving Data from the Provider This section describes how to retrieve data from a provider, using ...

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

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

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

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

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

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

随机推荐

  1. BI (商业智能)

    BI (商业智能) 编辑 商业智能(BI,Business Intelligence). BI(Business Intelligence)即商务智能,它是一套完整的解决方案,用来将企业中现有的数据进 ...

  2. AHB中split机制简介

    完整的AHB协议:1)可以多个master,并且需要外加一个Arbiter,和write multiplexor.为了保证每一时刻只有一个master拥有访问权. 2)为了增强pipeline的能力, ...

  3. Java :List

    1.List是一个接口,不能实例化,需要实例化一个ArrayList或者LinkedListList myList = new ArrayList(); 2.List中可以添加任何对象,包括自己定义的 ...

  4. tomcat支持的websocket服务

    首发:个人博客 在tomcat7之后的版本,写个websocket服务程序非常容易——如以下代码所示,当客户端建立了一个连接并发送了一些什么内容到服务器,服务器将每隔两秒返回一个字符串“world”. ...

  5. 161011、oracle批量插入数据

    需求:从一张表中查询数据插入到另外一张表 -- Created on 2016/10/13 by RICK declare -- Local variables here begin ') loop ...

  6. TI CC2541的狗日的Key

    被突如其来的一个bug困扰了好几天, 起因是, 按键接的红外接收器, 结果发现, 一旦按下之后, IEN1, P0IE的标识位bit5, 被不知道特么的谁归0了, 也就是说, 按键只能被按下一次, 再 ...

  7. 创建laravel项目时打开浏览器常见错误

    1.Whoops, looks like something went wrong. 打开:D:\java\wamp\www\subway\app\config\app.php 修改:'debug' ...

  8. 常用Git命令

    Git教程:http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000 一般来说,日常使用只要 ...

  9. 如何优化tomcat配置(从内存、并发、缓存4个方面)优化

    Tomcat有很多方面,我从内存.并发.缓存四个方面介绍优化方法.  ** 一.Tomcat内存优化 ** Tomcat内存优化主要是对 tomcat 启动参数优化,我们可以在 tomcat 的启动脚 ...

  10. win8以上版本离线安装.NET

    方法一.C盘自带.NET 3.5,安装系统以后直接安装.NET 3.5.     1.按下:win+x,点击“命令提示符(管理员),     2.输入或复制以下代码(不可漏空格):dism.exe / ...