Skip to content

Instantly share code, notes, and snippets.

@kdehairy
kdehairy / Repository.java
Last active May 6, 2017 10:19
An implementation of SQLiteOpenHelper that uses a pre-loaded database file in android
public class Repository extends SQLiteOpenHelper {
private static final int VERSION = 1;
private static final String DATABASE_NAME = "data.sqlite";
private static File DATABASE_FILE;
// This is an indicator if we need to copy the
// database file.
private boolean mInvalidDatabaseFile = false;
private boolean mIsUpgraded = false;
private Context mContext;