Esta es la clase de la Base de Datos. ¿Qué cambios tengo que hacer leerla desde una pasta de la tarjeta SD ?
public class MyDataBaseHelper extends SQLiteOpenHelper {
// Database name
public static String DATABASE_QUESTION = "govti.db";
// Current version of database
private static final int DATABASE_VERSION = 1;
// Database table name
private static final String TABLE_QUESTION = "GovTIBank";
// All fields used in database table
private static final String KEY_ID = "id";
private static final String QUESTION = "question";
private static final String CHOICE1 = "choice1";
private static final String CHOICE2 = "choice2";
private static final String CHOICE3 = "choice3";
private static final String CHOICE4 = "choice4";
private static final String CHOICE5 = "choice5";
private static final String ANSWER = "answer";
No he logrado éxito en los cambios. No sé como es usado "File.separator" Me sale un error:
Error:(52, 31) error: method getExternalFilesDir in class Context cannot be applied to given types; required: String found: no arguments reason: actual and formal argument lists differ in length
Mi código se quedó asi:
public class MyDataBaseHelper extends SQLiteOpenHelper {
private static final String FILE_DIR = "/storage/269B-7026/datadb/";
// Database name
public static String DATABASE_QUESTION = "govti.db";
// Current version of database
private static final int DATABASE_VERSION = 1;
// Database table name
...
public MyDataBaseHelper(Context context) {
super(context, context.getExternalFilesDir()
+ File.separator + FILE_DIR + File.separator
+ FILE_DIR + DATABASE_QUESTION, null, DATABASE_VERSION);
}
Gracias de antemano. Jose Bonfim