We are trying to create a mobile app using PhoneGap/Cordova. We need to ship this app with a pre-populated SQLite db. We are able to copy the DB using below code. But when w
In first place, can trying with the next DB file name:
0000000000000001.db
And for load file:
File dbFile = getDatabasePath(".0000000000000001db");
The DB file needs to be in the next route:
yourProyect/assets/0000000000000001.db
I recommend use "SQLitePlugin":
SQLitePlugin GitHub
In the "onDeviceReady()" function i use:
if(!dbCreated){
db = window.sqlitePlugin.openDatabase("0000000000000001", "1.0", "My Database", -1);
}