zoukankan      html  css  js  c++  java
  • [Android] Content provider, ContentResolver

    Content 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.

    在MainFast中需要注册一个provider, content provider 和 Activity 一个级别,所以需要在MainFast中写明:

     <provider android:name=".PersonProvider"
                android:authorities="thenewboston.providers.personProvider"></provider>

    authorities是内容提供者的唯一标识。

    ContentResolver是用来访问数据的。

    When you want to access data in a content provider, you use theContentResolver object in your application's Context to communicate with the provider as a client. The ContentResolverobject 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.

  • 相关阅读:
    作业 第四 张垚
    软件测试课堂练习 张垚
    增删改查
    计算器 作业
    activity 张垚
    第四作业 张垚
    第六周作业
    jsp第四周作业
    jsp求1-100之间的素数和
    JSP第一次测试
  • 原文地址:https://www.cnblogs.com/Answer1215/p/3818809.html
Copyright © 2011-2022 走看看