private void copydatabase() throws IOException {
InputStream myinput = mycontext.getAssets().open(DB_NAME);
String outfilename = DB_PATH + DB_NAME;
OutputStream myoutput = new FileOutputStream("/data/data/(packagename)/databases /(datbasename).sqlite");
byte[] buffer = new byte[1024];
int length;
while ((length = myinput.read(buffer))>0)
{
myoutput.write(buffer,0,length);
}
myoutput.flush();
myoutput.close();
myinput.close();
}
Do this for your second database.
source
share