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.

  • 相关阅读:
    网络协议 19
    网络协议 18
    网络协议 17
    网络协议 16
    网络协议 15
    .NET基础知识(01)-值类型与引用类型
    .NET基础知识(02)-拆箱与装箱
    网络协议 14
    网络协议 13
    网络协议 12
  • 原文地址:https://www.cnblogs.com/Answer1215/p/3818809.html
Copyright © 2011-2022 走看看