에서 복사 데이터베이스 (많은 답변에 있음) 내가 사용하고 코드입니다 : 그러나안드로이드 - 자산
InputStream myInput;
try {
myInput = iNezamApplication.getAppContext().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();
} catch (IOException e1) {
e1.printStackTrace();
}
, 난 항상 OutpoutStream 선에 도달 한 후 예외가 :
java.io.FileNotFoundException: /data/data/package_name/databases/databasename.db: open failed: ENOENT (No such file or directory)
노인보다는, 테스트, 디버깅 및 지원'SQLiteAssetHelper'로 전환 고려하시기 바랍니다 , 지원되지 않는 대구 전자 "많은 답변에서 발견됨": https://github.com/jgilfelt/android-sqlite-asset-helper – CommonsWare
감사합니다. 알고 있지만 사용하고 싶지 않습니다. 나는 내 질문에 대한 대답이 필요하다. –