Java 类android.app.backup.FileBackupHelper 实例源码
项目:GitHub
文件:BackupAgent.java
@Override
public void onCreate() {
Log.d("ConnectBot.BackupAgent", "onCreate called");
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
SharedPreferencesBackupHelper prefsHelper = new SharedPreferencesBackupHelper(this, getPackageName() + "_preferences");
addHelper(PreferenceConstants.BACKUP_PREF_KEY, prefsHelper);
FileBackupHelper hosts = new FileBackupHelper(this, "../databases/" + HostDatabase.DB_NAME);
addHelper(HostDatabase.DB_NAME, hosts);
if (prefs.getBoolean(PreferenceConstants.BACKUP_KEYS, PreferenceConstants.BACKUP_KEYS_DEFAULT)) {
FileBackupHelper pubkeys = new FileBackupHelper(this, "../databases/" + PubkeyDatabase.DB_NAME);
addHelper(PubkeyDatabase.DB_NAME, pubkeys);
}
}
项目:BgLogger
文件:MyBackupAgent.java
@Override
public void onCreate() {
// TODO Auto-generated method stub
FileBackupHelper helper1 = new FileBackupHelper(this, db1);
addHelper(db1, helper1);
FileBackupHelper helper2 = new FileBackupHelper(this, db2);
addHelper(db2, helper2);
FileBackupHelper helper3 = new FileBackupHelper(this, db3);
addHelper(db3, helper3);
FileBackupHelper helper4 = new FileBackupHelper(this, db4);
addHelper(db4, helper4);
FileBackupHelper helper5 = new FileBackupHelper(this, db5);
addHelper(db5, helper5);
}
项目:2048-Battles
文件:TheBackupAgent.java
@Override
public void onCreate() {
Log.d(LOG_TAG, "on create backup agent");
Log.d(LOG_TAG, CURRENT_GAME_FILENAME);
Log.d(LOG_TAG, GAME_STATS_FILENAME);
FileBackupHelper helper = new FileBackupHelper(this, CURRENT_GAME_FILENAME, GAME_STATS_FILENAME);
/*
SharedPreferencesBackupHelper helper =
new SharedPreferencesBackupHelper(this, GAME_PREFS_FILENAME);
*/
addHelper(FILES_BACKUP_KEY, helper);
}
项目:buildAPKsSamples
文件:FileHelperExampleAgent.java
/**
* The {@link android.app.backup.FileBackupHelper FileBackupHelper} class
* does nearly all of the work for our use case: backup and restore of a
* file stored within our application's getFilesDir() location. It will
* also handle files stored at any subpath within that location. All we
* need to do is a bit of one-time configuration: installing the helper
* when this agent object is created.
*/
@Override
public void onCreate() {
// All we need to do when working within the BackupAgentHelper mechanism
// is to install the helper that will process and back up the files we
// care about. In this case, it's just one file.
FileBackupHelper helper = new FileBackupHelper(this, BackupRestoreActivity.DATA_FILE_NAME);
addHelper(FILE_HELPER_KEY, helper);
}
项目:octoandroid
文件:OctoBackupAgent.java
@Override
public void onCreate() {
SharedPreferencesBackupHelper prefBackupHelper = new SharedPreferencesBackupHelper(this, DEFAULT_PREFS_FILENAME);
addHelper(DEFAULT_PREFS_KEY, prefBackupHelper);
// TODO not sure if need to implement synchronized since GreenDAO is thread safe...
FileBackupHelper dbBackupHelper = new FileBackupHelper(this, StorageModule.DB_NAME);
addHelper(PRINTER_DB_KEY, dbBackupHelper);
}
项目:flavordex
文件:FlavordexBackupAgent.java
@Override
public void onCreate() {
super.onCreate();
final FileBackupHelper db = new FileBackupHelper(this,
"../databases/" + DatabaseHelper.DATABASE_NAME);
addHelper(KEY_DB, db);
}
项目:connectbot
文件:BackupAgent.java
@Override
public void onCreate() {
Log.d("ConnectBot.BackupAgent", "onCreate called");
SharedPreferencesBackupHelper prefs = new SharedPreferencesBackupHelper(this, getPackageName() + "_preferences");
addHelper(PreferenceConstants.BACKUP_PREF_KEY, prefs);
FileBackupHelper hosts = new FileBackupHelper(this, "../databases/" + HostDatabase.DB_NAME);
addHelper(HostDatabase.DB_NAME, hosts);
FileBackupHelper pubkeys = new FileBackupHelper(this, "../databases/" + PubkeyDatabase.DB_NAME);
addHelper(PubkeyDatabase.DB_NAME, pubkeys);
}
项目:GoogleCloudApp_Tutorial
文件:BackupAPI.java
@Override
public void onCreate() {
FileBackupHelper helperFileBackupHelper = new FileBackupHelper(this, HIGH_SCORES_FILENAME);
addHelper(FILES_BACKUP_KEY, helperFileBackupHelper);
SharedPreferencesBackupHelper helperSharedPreferencesBackupHelper =
new SharedPreferencesBackupHelper(this, PREFS_DISPLAY, PREFS_SCORES);
addHelper(MY_PREFS_BACKUP_KEY, helperSharedPreferencesBackupHelper);
}
项目:android-giftwise
文件:BackupAgent.java
@Override
public void onCreate() {
Log.d(LOG_TAG, "onCreate called");
FileBackupHelper giftwise_database = new FileBackupHelper(this, "../databases/" + DbHelper.DATABASE_NAME);
addHelper(DbHelper.DATABASE_NAME, giftwise_database);
}
项目:cowbird
文件:APBackupAgent.java
@Override
public void onCreate() {
// getDatabasePath(DB_NAME).getAbsolutePath()
FileBackupHelper dbs = new FileBackupHelper(this, DB_NAME);
SharedPreferencesBackupHelper helper =
new SharedPreferencesBackupHelper(this, getPackageName() + "_preferences");
addHelper("prefs", helper);
addHelper("dbs", dbs);
}
项目:Key-Value-Backup-API-Sample
文件:BackupAgent.java
@Override
public void onCreate() {
super.onCreate();
FileBackupHelper helper = new FileBackupHelper(this, "one.txt", "two.txt", "three.txt");
addHelper("myfiles", helper);
}
项目:ServeStream
文件:BackupAgent.java
@Override
public void onCreate() {
Log.v(TAG, "onCreate called");
SharedPreferencesBackupHelper prefs = new SharedPreferencesBackupHelper(this, getPackageName() +
"_preferences");
addHelper(PreferenceConstants.BACKUP_PREF_KEY, prefs);
FileBackupHelper streams = new FileBackupHelper(this, "../databases/" + StreamDatabase.DATABASE_NAME);
addHelper(StreamDatabase.DATABASE_NAME, streams);
FileBackupHelper alarms = new FileBackupHelper(this, "../databases/" + DatabaseHelper.DATABASE_NAME);
addHelper(DatabaseHelper.DATABASE_NAME, alarms);
}
项目:CeaselessAndroid
文件:AppBackupAgentHelper.java
@Override
public void onCreate() {
SharedPreferencesBackupHelper helper = new SharedPreferencesBackupHelper(this, Constants.DEFAULT_PREFERENCES_FILE);
addHelper(PREFS_BACKUP_KEY, helper);
FileBackupHelper fileBackupHelper = new FileBackupHelper(this, Constants.REALM_FILE_NAME);
addHelper(FILES_BACKUP_KEY, fileBackupHelper);
}
项目:novelty
文件:BackupAgent.java
@Override
public void onCreate() {
SharedPreferencesBackupHelper sharedPrefsHelper = new SharedPreferencesBackupHelper(this,
DEFAULT_SHARED_PREFS_NAME);
addHelper(SHARED_PREFS_BACKUP_KEY, sharedPrefsHelper);
FileBackupHelper fileHelper = new FileBackupHelper(this, "../databases/" + DbProvider.DB_NAME);
addHelper(DbProvider.DB_NAME, fileHelper);
super.onCreate();
}
项目:android-money-manager-ex
文件:MoneyManagerBackupAgentHelper.java
@Override
public void onCreate() {
super.onCreate();
// create helper preferences
SharedPreferencesBackupHelper appHelper = new SharedPreferencesBackupHelper(this, getPackageName() + "_preferences");
SharedPreferencesBackupHelper dropboxHelper = new SharedPreferencesBackupHelper(this, getPackageName() + "_dropbox_preferences");
// create helper files
FileBackupHelper databaseHelper = new FileBackupHelper(this, MmexApplication.getDatabasePath(getApplicationContext()));
addHelper(KEY_BACKUP_APP_PREFERENCES, appHelper);
addHelper(KEY_BACKUP_DROPBOX_PREFERENCES, dropboxHelper);
// todo: addHelper(KEY_BACKUP_RECENT_DB_PREFERENCES, dr);
addHelper(KEY_BACKUP_DB, databaseHelper);
}
项目:SafeSlinger-Android
文件:KeyBackupAgent.java
@Override
public void onCreate() {
SharedPreferencesBackupHelper phelper = new SharedPreferencesBackupHelper(this,
SafeSlingerPrefs.PREFS_RECOVER_YES);
addHelper(PREFS_BACKUP_KEY, phelper);
FileBackupHelper fhelper = new FileBackupHelper(this, getBackupFiles());
addHelper(FILES_BACKUP_KEY, fhelper);
}
项目:servestream
文件:BackupAgent.java
@Override
public void onCreate() {
Log.v(TAG, "onCreate called");
SharedPreferencesBackupHelper prefs = new SharedPreferencesBackupHelper(this, getPackageName() +
"_preferences");
addHelper(PreferenceConstants.BACKUP_PREF_KEY, prefs);
FileBackupHelper streams = new FileBackupHelper(this, "../databases/" + StreamDatabase.DATABASE_NAME);
addHelper(StreamDatabase.DATABASE_NAME, streams);
FileBackupHelper alarms = new FileBackupHelper(this, "../databases/" + DatabaseHelper.DATABASE_NAME);
addHelper(DatabaseHelper.DATABASE_NAME, alarms);
}
项目:CineTime
文件:CineTimeBackupHelper.java
@Override
public void onCreate() {
SharedPreferencesBackupHelper helper = new SharedPreferencesBackupHelper(this, PREFS);
addHelper(PREFS_BACKUP_KEY, helper);
FileBackupHelper helperF = new FileBackupHelper(this, DB);
addHelper(FILES_BACKUP_KEY, helperF);
}
项目:appkicker
文件:InstallationBackupAgent.java
@Override
public void onCreate() {
FileBackupHelper filesHelper = new FileBackupHelper(this, DeviceObserver.INSTALLATION);
addHelper(FILES_BACKUP_KEY, filesHelper);
}
项目:LabCam
文件:BackupFileHelper.java
@Override
public void onCreate() {
FileBackupHelper helper = new FileBackupHelper(this, fileName);
addHelper(PFILES_BACKUP_KEY, helper);
}
项目:KinoCast
文件:BackupAgent.java
@Override
public void onCreate() {
FileBackupHelper helper = new FileBackupHelper(this, BOOKMARKS_FILENAME);
addHelper(FILES_BACKUP_KEY, helper);
}
项目:ministocks
文件:BackupAgent.java
public void onCreate() {
FileBackupHelper helper = new FileBackupHelper(this, PortfolioStockRepository.PORTFOLIO_JSON);
addHelper(FILES_BACKUP_KEY, helper);
}
项目:appsensor
文件:InstallationBackupAgent.java
@Override
public void onCreate() {
FileBackupHelper filesHelper = new FileBackupHelper(this, DeviceObserver.INSTALLATION);
addHelper(FILES_BACKUP_KEY, filesHelper);
}