Created
June 22, 2016 04:39
-
-
Save ccjeng/9436eebcc74f3c9b3bebc9ff027c008f to your computer and use it in GitHub Desktop.
BackupAgent for Android Backup API
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 TheBackupAgent extends BackupAgentHelper { | |
private static final String DB_NAME = "test.db"; // db name | |
@Override | |
public void onCreate() { | |
FileBackupHelper dbs = new FileBackupHelper(this, DB_NAME); | |
addHelper("dbs", dbs); | |
} | |
@Override | |
public File getFilesDir() { | |
final File f = getDatabasePath(DB_NAME); | |
return f.getParentFile(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment