Hi everyone i have one question i.e. i have some database table\'s which are already exist in database but i am not able to use them in my application. I am able to connect to d
Answer to my question is simpelly copy your database by using the followig code.
private void CopyDataBase() throws IOException {
// open the local database
InputStream copy = context.getAssets().open(UR_DB_NAME);
// path where database is created
String path_DB = DB_PATH + DB_NAME;
// Open the empty dbOut as the output stream
OutputStream dbOut = new FileOutputStream(path_DB);
// copy database from the inputfile to the outputfile
byte[] buffer = new byte[1024];
int length;
while ((length = copy.read(buffer)) > 0) {
dbOut.write(buffer, 0, length);
}
// Close the streams
dbOut.flush();
dbOut.close();
copy.close();
}