【翻译】(9)内容提供者

【翻译】(9)内容提供者

 

see

http://developer.android.com/guide/topics/providers/content-providers.html

 

原文见

http://developer.android.com/guide/topics/providers/content-providers.html

 

-------------------------------

 

Content Providers

 

内容提供者

 

-------------------------------

 

Topics

 

主题

 

Content Provider Basics 内容提供者基础

Creating a Content Provider 创建一个内容提供者

Calendar Provider 日历提供者

 

Related Samples

 

相关示例

 

Contact Manager application 电话簿管理器应用程序

"Cursor (People)" “游标(联系人)”

"Cursor (Phones)" “游标(电话)”

 

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.

 

当你希望访问一个内容提供者里的数据时,你使用你的应用程序的Context里的ContentResolver对象作为客户端与提供者通信。ContentResolver对象与提供者对象,一个实现ContentProvider的类的实体通信。提供者对象接收来自客户端的数据请求,执行请求动作,并且返回结果。

 

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 android.provider package. With some restrictions, these providers are accessible to any Android application.

 

Android自身包含内容提供者,它们管理数据诸如音频、视频、图片,以及个人电话簿信息。你可以看到它们中有一些列举在android.provider包的参考文档中。带有一些限制,这些提供者对于任何Android应用程序都是可访问的。

 

The following topics describe content providers in more detail:

 

以下主题更详细地描述内容提供者:

 

* Content Provider Basics

 

* 内容提供者基础

 

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

 

如何访问内容提供者中的数据,当数据在表中组织时。

 

* Creating a Content Provider

 

* 创建一个内容提供者

 

How to create your own content provider.

 

如何创建你自己的内容提供者。

 

* Calendar Provider

 

* 日历提供者

 

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

 

如何访问作为Android平台一部分的日历提供者。

 

Except as noted, this content is licensed under Apache 2.0. For details and restrictions, see the Content License.

 

除特别说明外,本文在Apache 2.0下许可。细节和限制请参考内容许可证。

 

Android 4.0 r1 - 27 Jan 2012 1:49

 

-------------------------------

 

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

 

(此页部分内容基于Android开源项目,以及使用根据创作公共2.5来源许可证描述的条款进行修改)

 

(本人翻译质量欠佳,请以官方最新内容为准,或者参考其它翻译版本:

* ソフトウェア技術ドキュメントを勝手に翻訳

http://www.techdoctranslator.com/android

* Ley's Blog

http://leybreeze.com/blog/

* 农民伯伯

http://www.cnblogs.com/over140/

* Android中文翻译组

http://androidbox.sinaapp.com/

 

你可能感兴趣的:(翻译)