6.3.1.3.1. DatabaseHelper

public class DatabaseHelper extends SQLiteOpenHelper

6.3.1.3.1.1. Constructors

6.3.1.3.1.1.1. DatabaseHelper

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

6.3.1.3.1.1.2. DatabaseHelper

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

6.3.1.3.1.2. Methods

6.3.1.3.1.2.1. onCreate

public void onCreate(SQLiteDatabase sqLiteDatabase)

is called whenever the app is freshly installed

Parameters:
  • sqLiteDatabase – Database

6.3.1.3.1.2.2. 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

Parameters:
  • sqLiteDatabase – Database
  • oldVersion – The previous database version
  • newVersion – The current database version