Android.Database.Sqlite.SQLiteOpenHelper Class
A helper class to manage database creation and version management.

See Also: SQLiteOpenHelper Members

Syntax

[Android.Runtime.Register("android/database/sqlite/SQLiteOpenHelper", DoNotGenerateAcw=true)]
public abstract class SQLiteOpenHelper : Java.Lang.Object

Remarks

A helper class to manage database creation and version management.

You create a subclass implementing SQLiteOpenHelper.OnCreate(SQLiteDatabase), SQLiteOpenHelper.OnUpgrade(SQLiteDatabase, System.Int32, System.Int32) and optionally SQLiteOpenHelper.OnOpen(SQLiteDatabase), and this class takes care of opening the database if it exists, creating it if it does not, and upgrading it as necessary. Transactions are used to make sure the database is always in a sensible state.

This class makes it easy for Android.Content.ContentProvider implementations to defer opening and upgrading the database until first use, to avoid blocking application startup with long-running database upgrades.

For an example, see the NotePadProvider class in the NotePad sample application, in the samples/ directory of the SDK.

Note: this class assumes monotonically increasing version numbers for upgrades.

[Android Documentation]

Requirements

Namespace: Android.Database.Sqlite
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1