I created an application and now I want to copy the database of this running application using my new backup application. I create my database path by doing DB_PATH + DB_NAME
using the following values:
DB_PATH = "/data/data/iCam.Cam/"; DB_NAME = "testdb.db";
I have a code that copies a database from a given path to an SD card. However, when I initially checked the database using the following method, it returns false
:
public boolean checkDataBase() { SQLiteDatabase checkDB = null; try { String myPath = DB_PATH + DB_NAME; checkDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY); } catch (SQLiteException e) { e.fillInStackTrace();
Any suggestions on how to achieve this?
source share