Android-Content Provider Basics
来源:互联网 发布:淘宝退款率高会降权吗 编辑:程序博客网 时间:2024/06/05 17:06
This topic describes the basics of the following:
- How content providers work.
- The API you use retrieve data from a content provider.
- The API you use to insert, update, or delete data in a content provider.
- Other API features that facilitate working with providers.
An application accesses the data from a content provider with a
ContentResolver
client object.The
ContentResolver
methods provide the basic "CRUD" (create, retrieve, update, and delete) functions of persistent storage.权限:android.permission.READ_USER_DICTIONARY;android.permission.WRITE_USER_DICTIONARY
<uses-permission android:name="android.permission.READ_USER_DICTIONARY">
Three alternative forms of provider access are important in application development:
- Batch access: You can create a batch of access calls with methods in the
ContentProviderOperation
class, and then apply them withContentResolver.applyBatch()
. - Asynchronous queries: You should do queries in a separate thread. One way to do this is to use a
CursorLoader
object. The examples in the Loaders guide demonstrate how to do this. - Data access via intents: Although you can't send an intent directly to a provider, you can send an intent to the provider's application, which is usually the best-equipped to modify the provider's data.
ContentResolver.applyBatch()
.The application that has permanent permissions grants temporary permissions by setting a flag in the result intent:
- Read permission:
FLAG_GRANT_READ_URI_PERMISSION
- Write permission:
FLAG_GRANT_WRITE_URI_PERMISSION
android:grantUriPermission
attribute of the <provider>
element, as well as the <grant-uri-permission>
child element of the<provider>
element. The URI permissions mechanism is explained in more detail in the Security and Permissions guide, in the section "URI Permissions". 0 0
- Android Content Provider Basics
- Android-Content Provider Basics
- Android API Guides---Content Provider Basics
- Content Provider Basics
- Content Provider Basics
- Content Provider(一) basics
- Content Provider Basics
- Content Provider Basics
- Content Provider Basics
- Content Provider Basics
- 官网翻译 Content Provider Basics
- 内容提供者基础 Content Provider Basics——翻译自developer.android.com
- Android Content Provider
- Android Content Provider
- Android Content Provider
- Android Content Provider
- Android Content Provider
- Android中的content provider
- java基础学习——变量,java基本类型,运算符和表达式
- Map , List Android
- 训练指南(白书)习题记录
- 获取网络时间(国家标准时间)
- 黑马程序员——java入门基础知识
- Android-Content Provider Basics
- Linux之win764位下基于EasyBCD的硬盘安装ubuntu32位双系统一些错误总结
- ArrayList和LinkedList
- 在Xcode中修改bundle display name让应用名字显示中文
- sublime text安装插件时提示There are no packages available for installation问题解决
- 排序(直接插入排序)
- ViewController生命周期
- 【LEETCODE】171-Excel Sheet Column Number
- Web App开发技巧