I have an SQLite database that I have generated using the SQLite JDBC connector found here.
I have then copied this database to my Android phone\'s SD card, and atte
Sqlite will only open databases from your applications database directory.
DB_PATH = "/data/data/"+ context.getPackageName() + "/databases/";
In order to read and write your database, my understanding is that you will need to copy your database to this location:
InputStream myInput = myContext.getAssets().open(DB_NAME);
String outFileName = DB_PATH + DB_NAME;
OutputStream myOutput = new FileOutputStream(outFileName);
byte[] buffer = new byte[1024];
int length;
while ((length = myInput.read(buffer))>0){
myOutput.write(buffer, 0, length);
}
myOutput.flush();
myOutput.close();
myInput.close();
In order to do this copy, you will first have to open a database at the eventual destination of your database file:
checkDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);
Let me know if you have any questions