How can I add a new column or new table to the database that pre-populated (in the assets) using SQLiteAssetHelper. I originally preload a simple table with 3 columns:
- id
- question
- answer
Once installed the app, I need to add some columns that will be populated with user data, like marked as favorite, seen before, edited... Also I need to add a new table that record the time of the study session, and last question seen. here's my code:
import android.content.Context;
import com.readystatesoftware.sqliteasset.SQLiteAssetHelper;
public class DatabaseOpenHelper extends SQLiteAssetHelper {
private static final int DATABASE_VERSION = 1;
private static final String DATABASE_NAME = "mydatabase.db.sqlite";
public DatabaseOpenHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
}
and
public class DatabaseAccess {
private SQLiteOpenHelper openHelper;
private SQLiteDatabase database;
private static DatabaseAccess instance;