В моем приложении предварительно заполненная база данных хранится / хранится в папке ресурсов в папке ресурсов.
Я могу прочитать его. Но как я могу получить доступный для записи дескриптор базы данных, потому что я хочу обновить эту предварительно заполненную базу данных.
public Database_Opener(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
this.context = context;
}
public void create_Database() throws IOException{
boolean DBExists = checkDatabaseExistance();
if(DBExists){
// Do Nothing Becoz Database is Already Exists
Log.i("Database", " Is Already Exists");
}else{
// Create and Copy Database
Log.i("Database", " Doesn't Exist and need to be Created");
// this is just a readable database handle
this.getReadableDatabase();
try {
copyDataBase();
} catch (Exception e) {
throw new Error("Error Copying Database");
}
}
Log.i("Existing Database " ," IS successfully Opened");
}