I'm trying to create a db file (SQLite) on the device disk - and all works fine with no exception - but the file does not created.
added these permissions
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
The code:
public class DbHandler extends SQLiteOpenHelper {
private static final int DATABASE_VERSION = 1;
private static final String DATABASE_NAME = "myAppDatabase.db";
private static final String PersistenceFolder = Environment.getExternalStorageDirectory() + File.separator + "MyApp" + File.separator;
private static final String PersistenceFilePath = PersistenceFolder + DATABASE_NAME;
public DbHandler(Context context) {
super(context, PersistenceFilePath, null, DATABASE_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
createTable1();
createTable2();
}
private void createTable1(){
// create table 1 with no exception
}
private void createTable2(){
// create table 2 with no exception
}
}
adb shell? Are you using something else?