I am looking to create a sqlite database on an SD card (I do not want to use the user's internal storage). I am familiar with the OpenHelper pattern:
public DatabaseFoo(Context context) { OpenHelper openHelper = new OpenHelper(context); mDb = openHelper.getWritableDatabase(); } private static class OpenHelper extends SQLiteOpenHelper { public OpenHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); } ...
therefore, if we want to create on an SD card, I think we should use instead:
public static SQLiteDatabase openOrCreateDatabase (String path, SQLiteDatabase.CursorFactory factory);
But what should be the "factory" argument, which factory should be used?
Also a little worried about what happens if the user removes the SD card while my application is using.
thank
android sqlite android-sdcard
user291701 Jan 26 2018-11-11T00: 00Z
source share