Java 类android.app.backup.SharedPreferencesBackupHelper 实例源码
项目: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);
}
}
项目:trackworktime
文件:WorkTimeTrackerBackupAgentHelper.java
@Override
public void onCreate() {
// The name of the SharedPreferences file
final String prefs = getPackageName() + "_preferences"; // getPackageName() cannot be used in final
SharedPreferencesBackupHelper prefsHelper = new SharedPreferencesBackupHelper(this, prefs) {
@Override
public void performBackup(ParcelFileDescriptor oldState, BackupDataOutput data,
ParcelFileDescriptor newState) {
if (new WorkTimeTrackerBackupManager(WorkTimeTrackerBackupAgentHelper.this).isEnabled()) {
super.performBackup(oldState, data, newState);
}
}
};
addHelper(PREFS_BACKUP_KEY, prefsHelper);
DbBackupHelper dbHelper = new DbBackupHelper(this);
addHelper(DB_BACKUP_KEY, dbHelper);
}
项目:Clip-Stack
文件:GoogleBackupAgent.java
@Override
public void onCreate() {
DbBackupHelper dataBaseBackupHelper =
new DbBackupHelper(
this,
Storage.StorageHelper.DATABASE_NAME
);
SharedPreferencesBackupHelper mainSharedPreferencesBackupHelper =
new SharedPreferencesBackupHelper(
this,
DEFAULT_PREFERENCE
);
addHelper(BACKUP_PREFERENCE, mainSharedPreferencesBackupHelper);
addHelper(BACKUP_DATABASE, dataBaseBackupHelper);
super.onCreate();
}
项目: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);
}
项目:teardrop
文件:PreferencesBackupAgent.java
@Override
public void onCreate()
{
// This is the preference name used by PreferenceManager.getDefaultSharedPreferences
String prefs = getPackageName() + "_preferences";
addHelper(BACKUP_KEY, new SharedPreferencesBackupHelper(this, prefs));
}
项目:dashbar
文件:BackupAgent.java
@Override
public void onCreate() {
// Compute the default preferences filename.
String defaultPrefsFilename = getPackageName() + "_preferences";
addHelper(PREFS_BACKUP_KEY,
new SharedPreferencesBackupHelper(this, defaultPrefsFilename));
}
项目: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);
}
项目:geohashdroid
文件:GHDBackupAgent.java
@Override
public void onCreate() {
// Hoo boy, there's a few prefs to back up...
SharedPreferencesBackupHelper helper = new SharedPreferencesBackupHelper(
this,
GHDConstants.PREF_AUTOZOOM,
GHDConstants.PREF_COORD_UNITS,
GHDConstants.PREF_DEFAULT_GRATICULE_GLOBALHASH,
GHDConstants.PREF_DEFAULT_GRATICULE_LATITUDE,
GHDConstants.PREF_DEFAULT_GRATICULE_LONGITUDE,
GHDConstants.PREF_DIST_UNITS,
GHDConstants.PREF_INFOBOX,
GHDConstants.PREF_KNOWN_LOCATIONS,
GHDConstants.PREF_LAST_MAP_TYPE,
GHDConstants.PREF_LAST_SEEN_VERSION,
GHDConstants.PREF_NEARBY_POINTS,
GHDConstants.PREF_SHOW_KNOWN_LOCATIONS,
GHDConstants.PREF_STARTUP_BEHAVIOR,
GHDConstants.PREF_STOCK_ALARM,
GHDConstants.PREF_STOCK_CACHE_SIZE,
GHDConstants.PREF_STOP_BUGGING_ME_PREFETCH_WARNING,
GHDConstants.PREF_WIKI_PASS,
GHDConstants.PREF_WIKI_USER,
GHDConstants.PREF_NIGHT_MODE
);
addHelper(PREFS_BACKUP_KEY, helper);
}
项目:tazapp-android
文件:TazBackupHelper.java
@SuppressLint("NewApi")
@Override
public void onCreate() {
super.onCreate();
String prefsName = Build.VERSION.SDK_INT >= Build.VERSION_CODES.N ? PreferenceManager.getDefaultSharedPreferencesName(
this) : getDefaultSharedPreferencesName(this);
SharedPreferencesBackupHelper helper = new SharedPreferencesBackupHelper(this, prefsName);
addHelper(PREFS_BACKUP_KEY, helper);
}
项目:dashclock
文件:BackupAgent.java
@Override
public void onCreate() {
// Compute the default preferences filename.
String defaultPrefsFilename = getPackageName() + "_preferences";
addHelper(PREFS_BACKUP_KEY,
new SharedPreferencesBackupHelper(this, defaultPrefsFilename));
}
项目: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);
}
项目:dscautorename
文件:DSCBackupAgent.java
public void onCreate() {
Context app = getApplicationContext();
if (app instanceof DSCApplication) {
mApplication = (DSCApplication) app;
}
SharedPreferencesBackupHelper helper =
new SharedPreferencesBackupHelper(this, getDefaultSharedPreferencesName());
addHelper(MY_PREFS_BACKUP_KEY, helper);
}
项目:FanFictionReader
文件:BackupAgent.java
@Override
public void onCreate() {
super.onCreate();
// Back up all the preferences
SharedPreferencesBackupHelper prefHelper = new SharedPreferencesBackupHelper(this, PREF_DEF);
addHelper(KEY_PREF, prefHelper);
}
项目: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();
}
项目:Bill-Calculator
文件:PrefsAndDbBackupAgent.java
@Override
public void onCreate() {
addHelper("PREFS_BACKUP_KEY", new SharedPreferencesBackupHelper(this,
ApplicationModule.SHARED_PREFERENCES_FILE,
getPackageName() + "_preferences"));
addHelper("DB_BACKUP_KEY", new DbBackupHelper(this, Database.DB_NAME));
}
项目:gearshift
文件:BackupAgent.java
@Override
public void onCreate() {
String packageName = getPackageName();
SharedPreferencesBackupHelper helper =
new SharedPreferencesBackupHelper(this,
packageName + "_preferences", G.PROFILES_PREF_NAME);
addHelper(PREFS_BACKUP_KEY, helper);
G.logD("Backup agent invoked.");
}
项目: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);
}
项目:DashClock
文件:BackupAgent.java
@Override
public void onCreate() {
// Compute the default preferences filename.
String defaultPrefsFilename = getPackageName() + "_preferences";
addHelper(PREFS_BACKUP_KEY,
new SharedPreferencesBackupHelper(this, defaultPrefsFilename));
}
项目:geoPingProject
文件:GeoPingBackupAgent.java
@Override
public void onCreate() {
// Prefs
SharedPreferencesBackupHelper helperPrefs = new TestSharedPreferencesBackupHelper(this, PREFS, AppConstants.PREFS_FILE_LOGIN);
addHelper(BACKUP_KEY_PREFS, helperPrefs);
// Database Pairing
PairingDbBackupHelper helperDbPairing = new PairingDbBackupHelper(this);
addHelper(PairingDbBackupHelper.BACKUP_KEY_PAIRING_DB, helperDbPairing);
// Database GeoFence
GeoFenceDbBackupHelper helperDbGeofence = new GeoFenceDbBackupHelper(this);
addHelper(GeoFenceDbBackupHelper.BACKUP_KEY_GEOFENCE_DB, helperDbGeofence);
// Database Person
PersonDbBackupHelper helperDbPerson = new PersonDbBackupHelper(this);
addHelper(PersonDbBackupHelper.BACKUP_KEY_PERSON_DB, helperDbPerson);
}
项目:altidroid
文件:AltidroidBackupAgent.java
@Override
public void onCreate() {
addHelper("prefs",
new SharedPreferencesBackupHelper(this, Preferences.PREFS_NAME));
addHelper("log",
new DatabaseBackupHelper(this, LogEntry.Columns.getContentUri(this), mLogAdapter));
super.onCreate();
}
项目:Plume-For-DashClock
文件:BackupAgent.java
@Override
public void onCreate() {
super.onCreate();
String defaultPrefsFilename = getPackageName() + "_preferences";
SharedPreferencesBackupHelper helper = new SharedPreferencesBackupHelper(this, defaultPrefsFilename);
addHelper(PREFS_BACKUP_KEY, helper);
}
项目:Dash
文件:BackupAgent.java
@Override
public void onCreate() {
// Compute the default preferences filename.
String defaultPrefsFilename = getPackageName() + "_preferences";
addHelper(PREFS_BACKUP_KEY,
new SharedPreferencesBackupHelper(this, defaultPrefsFilename));
}
项目: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);
}
项目:keepass2android
文件:LatinIMEBackupAgent.java
@Override
public void onCreate() {
addHelper("shared_pref", new SharedPreferencesBackupHelper(this,
getPackageName() + "_preferences"));
}
项目:AOSP-Kayboard-7.1.2
文件:BackupAgent.java
@Override
public void onCreate() {
addHelper("shared_pref", new SharedPreferencesBackupHelper(this,
getPackageName() + PREF_SUFFIX));
}
项目:KeePass2Android
文件:LatinIMEBackupAgent.java
@Override
public void onCreate() {
addHelper("shared_pref", new SharedPreferencesBackupHelper(this,
getPackageName() + "_preferences"));
}
项目:science-journal
文件:SimpleBackupAgent.java
@Override
public void onCreate() {
String prefsName = getDefaultStoredPreferencesName(getApplicationContext());
SharedPreferencesBackupHelper helper = new SharedPreferencesBackupHelper(this, prefsName);
addHelper(PREFS_BACKUP_KEY, helper);
}
项目:Audinaut
文件:SettingsBackupAgent.java
@Override
public void onCreate() {
super.onCreate();
SharedPreferencesBackupHelper helper = new SharedPreferencesBackupHelper(this, Constants.PREFERENCES_FILE_NAME);
addHelper("mypreferences", helper);
}
项目:hackerskeyboard
文件:LatinIMEBackupAgent.java
@Override
public void onCreate() {
addHelper("shared_pref", new SharedPreferencesBackupHelper(this,
getPackageName() + "_preferences"));
}
项目:android-protips-location
文件:PlacesBackupAgent.java
@Override
public void onCreate() {
SharedPreferencesBackupHelper helper = new SharedPreferencesBackupHelper(this, PlacesConstants.SHARED_PREFERENCE_FILE);
addHelper(PlacesConstants.SP_KEY_FOLLOW_LOCATION_CHANGES, helper);
// TODO Add additional helpers for each of the preferences you want to backup.
}
项目:v2ex-android
文件:BackupAgent.java
public void onCreate() {
super.onCreate();
BackupHelper helper = new SharedPreferencesBackupHelper(this, PREFS_PREF);
addHelper(PREFS_BACKUP_KEY, helper);
}
项目:shortyz
文件:BackupAgent.java
public void onCreate() {
SharedPreferencesBackupHelper helper = new SharedPreferencesBackupHelper(this, PREFS);
addHelper(PREFS_BACKUP_KEY, helper);
}
项目:android-device-identification
文件:SimpleBackupAgent.java
@Override
public void onCreate() {
SharedPreferencesBackupHelper helper = new SharedPreferencesBackupHelper(this, PREFS);
addHelper(PREFS_BACKUP_KEY, helper);
}
项目:Noyze
文件:VolumeBackupAgent.java
@Override
public void onCreate() {
addHelper(SharedPreferences.class.getSimpleName(),
new SharedPreferencesBackupHelper(this, getPackageName() + "_preferences"));
}
项目:sprockets-android
文件:DefaultSharedPreferencesBackupAgent.java
@Override
public void onCreate() {
super.onCreate();
String name = EasySharedPreferences.getDefaultName(this);
addHelper(name, new SharedPreferencesBackupHelper(this, name));
}