DatabaseHelper

public class DatabaseHelper extends SQLiteOpenHelper

Constructors

DatabaseHelper

public DatabaseHelper(Context context, File dbFullName, SQLiteDatabase.CursorFactory factory, int version)

DatabaseHelper

public DatabaseHelper(Context context, File dbFullName, SQLiteDatabase.CursorFactory factory, int version, DatabaseErrorHandler errorHandler)

Methods

onCreate

public void onCreate(SQLiteDatabase sqLiteDatabase)

is called whenever the app is freshly installed

Параметры:
  • sqLiteDatabase – Database

onUpgrade

public void onUpgrade(SQLiteDatabase sqLiteDatabase, int oldVersion, int newVersion)

is called whenever the app is upgraded and launched and the database version is not the same

Параметры:
  • sqLiteDatabase – Database
  • oldVersion – The previous database version
  • newVersion – The current database version