public final class

Context

extends Object
java.lang.Object
   ↳ com.tencent.wcdb.support.Context

Class Overview

Wrapper class to implement database opening methods as android.content.Context does.

Summary

Constants
int MODE_ENABLE_WRITE_AHEAD_LOGGING
Public Constructors
Context()
Public Methods
static SQLiteDatabase openOrCreateDatabase(Context context, String name, int mode, SQLiteDatabase.CursorFactory factory)
Open a new private SQLiteDatabase associated with this Context's application package.
static SQLiteDatabase openOrCreateDatabase(Context context, String name, byte[] password, SQLiteCipherSpec cipher, int mode, SQLiteDatabase.CursorFactory factory, DatabaseErrorHandler errorHandler)
static SQLiteDatabase openOrCreateDatabase(Context context, String name, int mode, SQLiteDatabase.CursorFactory factory, DatabaseErrorHandler errorHandler)
static SQLiteDatabase openOrCreateDatabase(Context context, String name, byte[] password, SQLiteCipherSpec cipher, int mode, SQLiteDatabase.CursorFactory factory)
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int MODE_ENABLE_WRITE_AHEAD_LOGGING

Constant Value: 8 (0x00000008)

Public Constructors

public Context ()

Public Methods

public static SQLiteDatabase openOrCreateDatabase (Context context, String name, int mode, SQLiteDatabase.CursorFactory factory)

Open a new private SQLiteDatabase associated with this Context's application package. Create the database file if it doesn't exist.

Parameters
name The name (unique in the application package) of the database.
mode Operating mode. Use 0 or MODE_PRIVATE for the default operation. Use MODE_ENABLE_WRITE_AHEAD_LOGGING to enable write-ahead logging by default. Use MODE_NO_LOCALIZED_COLLATORS to disable localized collators.
factory An optional factory class that is called to instantiate a cursor when query is called.
Returns
  • The contents of a newly created database with the given name.
Throws
SQLiteException if the database file could not be opened.

public static SQLiteDatabase openOrCreateDatabase (Context context, String name, byte[] password, SQLiteCipherSpec cipher, int mode, SQLiteDatabase.CursorFactory factory, DatabaseErrorHandler errorHandler)

public static SQLiteDatabase openOrCreateDatabase (Context context, String name, int mode, SQLiteDatabase.CursorFactory factory, DatabaseErrorHandler errorHandler)

public static SQLiteDatabase openOrCreateDatabase (Context context, String name, byte[] password, SQLiteCipherSpec cipher, int mode, SQLiteDatabase.CursorFactory factory)