当前位置: 首页>>代码示例>>Java>>正文


Java SharedPreferencesBackupHelper类代码示例

本文整理汇总了Java中android.app.backup.SharedPreferencesBackupHelper的典型用法代码示例。如果您正苦于以下问题:Java SharedPreferencesBackupHelper类的具体用法?Java SharedPreferencesBackupHelper怎么用?Java SharedPreferencesBackupHelper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SharedPreferencesBackupHelper类属于android.app.backup包,在下文中一共展示了SharedPreferencesBackupHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import android.app.backup.SharedPreferencesBackupHelper; //导入依赖的package包/类
@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);
	}
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:18,代码来源:BackupAgent.java

示例2: onCreate

import android.app.backup.SharedPreferencesBackupHelper; //导入依赖的package包/类
@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);
}
 
开发者ID:mathisdt,项目名称:trackworktime,代码行数:19,代码来源:WorkTimeTrackerBackupAgentHelper.java

示例3: onCreate

import android.app.backup.SharedPreferencesBackupHelper; //导入依赖的package包/类
@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();
}
 
开发者ID:heruoxin,项目名称:Clip-Stack,代码行数:17,代码来源:GoogleBackupAgent.java

示例4: onCreate

import android.app.backup.SharedPreferencesBackupHelper; //导入依赖的package包/类
@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);
}
 
开发者ID:nairbspace,项目名称:octoandroid,代码行数:10,代码来源:OctoBackupAgent.java

示例5: onCreate

import android.app.backup.SharedPreferencesBackupHelper; //导入依赖的package包/类
@Override
public void onCreate()
{
	// This is the preference name used by PreferenceManager.getDefaultSharedPreferences
	String prefs = getPackageName() + "_preferences";
	addHelper(BACKUP_KEY, new SharedPreferencesBackupHelper(this, prefs));
}
 
开发者ID:owoc,项目名称:teardrop,代码行数:8,代码来源:PreferencesBackupAgent.java

示例6: onCreate

import android.app.backup.SharedPreferencesBackupHelper; //导入依赖的package包/类
@Override
public void onCreate() {
    // Compute the default preferences filename.
    String defaultPrefsFilename = getPackageName() + "_preferences";
    addHelper(PREFS_BACKUP_KEY,
            new SharedPreferencesBackupHelper(this, defaultPrefsFilename));
}
 
开发者ID:mridang,项目名称:dashbar,代码行数:8,代码来源:BackupAgent.java

示例7: onCreate

import android.app.backup.SharedPreferencesBackupHelper; //导入依赖的package包/类
@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);

}
 
开发者ID:dragonlinux,项目名称:connectbot,代码行数:15,代码来源:BackupAgent.java

示例8: onCreate

import android.app.backup.SharedPreferencesBackupHelper; //导入依赖的package包/类
@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);
}
 
开发者ID:GeeksEmpireNet,项目名称:GoogleCloudApp_Tutorial,代码行数:10,代码来源:BackupAPI.java

示例9: onCreate

import android.app.backup.SharedPreferencesBackupHelper; //导入依赖的package包/类
@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);
}
 
开发者ID:CaptainSpam,项目名称:geohashdroid,代码行数:28,代码来源:GHDBackupAgent.java

示例10: onCreate

import android.app.backup.SharedPreferencesBackupHelper; //导入依赖的package包/类
@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);
}
 
开发者ID:die-tageszeitung,项目名称:tazapp-android,代码行数:10,代码来源:TazBackupHelper.java

示例11: onCreate

import android.app.backup.SharedPreferencesBackupHelper; //导入依赖的package包/类
@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);
    }
 
开发者ID:rafaelcoutinho,项目名称:cowbird,代码行数:10,代码来源:APBackupAgent.java

示例12: onCreate

import android.app.backup.SharedPreferencesBackupHelper; //导入依赖的package包/类
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);
}
 
开发者ID:ciubex,项目名称:dscautorename,代码行数:10,代码来源:DSCBackupAgent.java

示例13: onCreate

import android.app.backup.SharedPreferencesBackupHelper; //导入依赖的package包/类
@Override
public void onCreate() {
	super.onCreate();

	// Back up all the preferences
	SharedPreferencesBackupHelper prefHelper = new SharedPreferencesBackupHelper(this, PREF_DEF);
	addHelper(KEY_PREF, prefHelper);
}
 
开发者ID:genious7,项目名称:FanFictionReader,代码行数:9,代码来源:BackupAgent.java

示例14: onCreate

import android.app.backup.SharedPreferencesBackupHelper; //导入依赖的package包/类
@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);
  }
 
开发者ID:wseemann,项目名称:ServeStream,代码行数:16,代码来源:BackupAgent.java

示例15: onCreate

import android.app.backup.SharedPreferencesBackupHelper; //导入依赖的package包/类
@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);
}
 
开发者ID:ceaseless-prayer,项目名称:CeaselessAndroid,代码行数:8,代码来源:AppBackupAgentHelper.java


注:本文中的android.app.backup.SharedPreferencesBackupHelper类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。