跳转到相应内容

最常访问

最近访问

navigation
added in API level 1

android.database

Contains classes to explore data returned through a content provider.

If you need to manage data in a private database, use the android.database.sqlite classes. These classes are used to manage the Cursor object returned from a content provider query. Databases are usually created and opened with openOrCreateDatabase(String, int, SQLiteDatabase.CursorFactory) To make requests through content providers, you can use the content.ContentResolver class.

All databases are stored on the device in /data/data/<package_name>/databases

Interfaces

CrossProcessCursor A cross process cursor is an extension of a Cursor that also supports usage from remote processes. 
Cursor This interface provides random read-write access to the result set returned by a database query. 
DatabaseErrorHandler An interface to let apps define an action to take when database corruption is detected. 

Classes

AbstractCursor This is an abstract cursor class that handles a lot of the common code that all cursors need to deal with and is provided for convenience reasons. 
AbstractCursor.SelfContentObserver Cursors use this class to track changes others make to their URI. 
AbstractWindowedCursor A base class for Cursors that store their data in CursorWindows. 
CharArrayBuffer This is used for copyStringToBuffer(int, CharArrayBuffer)  
ContentObservable A specialization of Observable for ContentObserver that provides methods for sending notifications to a list of ContentObserver objects. 
ContentObserver Receives call backs for changes to content. 
CrossProcessCursorWrapper Cursor wrapper that implements CrossProcessCursor
CursorJoiner Does a join on two cursors using the specified columns. 
CursorWindow A buffer containing multiple cursor rows. 
CursorWrapper Wrapper class for Cursor that delegates all calls to the actual cursor object. 
DatabaseUtils Static utility methods for dealing with databases and Cursors. 
DatabaseUtils.InsertHelper This class was deprecated in API level 17. Use SQLiteStatement instead.  
DataSetObservable A specialization of Observable for DataSetObserver that provides methods for sending notifications to a list of DataSetObserver objects. 
DataSetObserver Receives call backs when a data set has been changed, or made invalid. 
DefaultDatabaseErrorHandler Default class used to define the action to take when database corruption is reported by sqlite. 
MatrixCursor A mutable cursor implementation backed by an array of Objects. 
MatrixCursor.RowBuilder Builds a row of values using either of these approaches:
  • Values can be added with explicit column ordering using add(Object), which starts from the left-most column and adds one column value at a time. 
MergeCursor A convenience class that lets you present an array of Cursors as a single linear Cursor. 
Observable<T> Provides methods for registering or unregistering arbitrary observers in an ArrayList

Enums

CursorJoiner.Result The result of a call to next(). 

Exceptions

CursorIndexOutOfBoundsException An exception indicating that a cursor is out of bounds. 
SQLException An exception that indicates there was an error with SQL parsing or execution. 
StaleDataException This exception is thrown when a Cursor contains stale data and must be requeried before being used again. 
此网站会使用 Cookie 来存储您在此网站上指定的语言和显示选项偏好设置。

获取最新的 Android Developers 资讯和提示,助您在 Google Play 上取得成功。

* 必填字段

成功!

在微信上关注 Google Developers

要以浏览此网站吗?

您请求访问的是网页,但是您为此网站设置的语言偏好为

要更改您的语言偏好设置并以浏览此网站吗?如果以后您想要更改语言偏好设置,请使用每个页面底部的语言菜单。

该类需要 或更高的 API 级别

此文档已被隐藏,因为您为该文档选择的 API 级别是 。您可以使用左侧导航栏上方的选择器来更改文档的 API 级别。

要详细了解如何根据您的应用需求指定 API 级别,请参阅支持不同平台版本

Take a short survey?
Help us improve the Android developer experience. (April 2018 — Developer Survey)