Skip to main content

Posts

Showing posts from 2015

BackUp & Restore in android

How to get the BackUp data into the SD Card & Restore it again into the app? // Method to get Backup from an app Database private void exportDB() {        try {            File sd = Environment.getExternalStorageDirectory();            File data = Environment.getDataDirectory();            if (sd.canWrite()) {                String currentDBPath = "//data//" + "App Package Name" + "//databases//" + DATABASES[0];                String backupDBPath = DATABASES[0];                File currentDB = new File(data, currentDBPath);                File backupDB = new File(sd, backupDBPath);                FileChannel src = new FileInputStream(currentDB).getChannel();   ...