android provider 结构化数据,Content Providers

Content provider管理android以结构化方式存放的数据。他以相对安全的方式封装数据并且提供简易的处理机制。Content provider提供不同进程间数据交互的标准化接口。

当你准备取出content provider中的数据时,你需要获得一个和当前上下文相关的ContentResolver对象作为客户端。这个对象和一个继承至ContentProvider的provider对象相关联。provider从客户端接收请求并且返回结果。

如果你不准备和其他应用共享你的数据,你不需要自定义provider。但是,你需要实现provider以满足个性化搜索数据的需求。同时,当你拷贝和粘贴复杂数据或者文件到他人应用中时,也需要provider。

以下是英文部分,请选择性阅读:

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

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.

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

The following topics describe content providers in more detail:

How to access data in a content provider when the data is organized in tables.

How to create your own content provider.

How to access the Calendar Provider that is part of the Android platform.

How to access the Contacts Provider that is part of the Android platform.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值