Back to project page MythTrack.
The source code is released under:
MIT License
If you think the Android project MythTrack listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/** * MythTrackBackup handles backing up the database through the Google Backup API. */*from www. j a va 2 s.c om*/ * @author Nolan Jurgens */ // FIXME - Backups broken on 4.3? package nolanjurgens.mythtrack.provider; // IMPORTS ///////////////////////////////////////////////////////////////////////////////////////// import android.app.backup.BackupAgentHelper; import android.app.backup.FileBackupHelper; import android.app.backup.SharedPreferencesBackupHelper; import android.content.SharedPreferences; //////////////////////////////////////////////////////////////////////////////////////////////////// // CLASS - MythTrackBackup // //////////////////////////////////////////////////////////////////////////////////////////////////// public class MythTrackBackup extends BackupAgentHelper { /** Key to uniquely identify the database backup set.*/ static final String DATABASE_BACKUP_KEY = "MythTrackDatabase"; /** Relative path to the database file.*/ static final String DATABASE_FILENAME = "../databases/" + MythTrackDatabase.MythTrackDatabaseHelper.DATABASE_NAME; /** Key to uniquely identify the preferences backup set.*/ static final String PREFERENCES_BACKUP_KEY = "MythTrackPreferences"; /** Relative path to the preferences file.*/ static final String PREFERENCES_FILENAME = "../shared_prefs/nolanjurgens.mythtrack_preferences.xml"; /** * Allocate a helper and add it to the backup agent. */ @Override public void onCreate() { // Specify the files to back up. FileBackupHelper fileBackupHelper = new FileBackupHelper(this, DATABASE_FILENAME); addHelper(DATABASE_BACKUP_KEY, fileBackupHelper); // Specify the preferences to back up. SharedPreferencesBackupHelper sharedPreferencesBackupHelper = new SharedPreferencesBackupHelper(this,PREFERENCES_FILENAME); addHelper(PREFERENCES_BACKUP_KEY, sharedPreferencesBackupHelper); } }