This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DatabaseHelper extends SQLiteOpenHelper { | |
/** | |
* create a copy of database file from data/data to sdcard | |
*/ | |
public static void dbBackup(@NonNull Context context) { | |
try { | |
String databaseName="myDb.db"; | |
String outFileName="myDb" + Calendar.getInstance().getTimeInMillis() + ".db"; | |
//Open your local db as the input stream | |
InputStream myInput = new FileInputStream(context.getDatabasePath(databaseName)); |