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.

  • 相关阅读:
    [面试题]什么是面向对象编程
    面向对象编程的新手理解
    Object of type type is not JSON serializable
    STL---map
    STL---llist
    Div标签使用inline-block有间距
    STL---vector
    KMP算法
    算法06
    算法05
  • 原文地址:https://www.cnblogs.com/Answer1215/p/3818809.html
Copyright © 2011-2022 走看看