Room Database Backup And Restore
If you are using room database, you can use this library for full backup and restore. Also you can encrypt output file with your desired secret key.
This library is also available at JitPack.io
Setup
The simplest way to use this library is to add the library as dependency to your build.
Gradle
Add it in your root build.gradle at the end of repositories:
Step 2. Add the dependency
Usage
Backup
Restore
new Restore.Init() .database(database) .backupFilePath("path-to-backup-file/filename.txt") .secretKey("your-secret-key") // if your backup file is encrypted, this parameter is required .onWorkFinishListener(new OnWorkFinishListener() { @Override public void onFinished(boolean success, String message) { // do anything } }) .execute();
