我的应用程序已将预先填充的数据库存储/驻留在资源文件夹下的资产文件夹中。 我可以读它。但是我怎么能得到一个可写的数据库句柄becoz我想更新那个预先填充的数据库。
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");
}