implement cloud settings backup
This commit is contained in:
parent
80a234cc15
commit
7f98676957
@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="org.fox.ttrss"
|
package="org.fox.ttrss"
|
||||||
android:versionCode="43"
|
android:versionCode="44"
|
||||||
android:versionName="0.3.10" >
|
android:versionName="0.3.11" >
|
||||||
|
|
||||||
<uses-sdk android:minSdkVersion="7" />
|
<uses-sdk android:minSdkVersion="7" />
|
||||||
|
|
||||||
@ -11,6 +11,8 @@
|
|||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
|
android:allowBackup="true"
|
||||||
|
android:backupAgent="PrefsBackupAgent"
|
||||||
android:hardwareAccelerated="true"
|
android:hardwareAccelerated="true"
|
||||||
android:icon="@drawable/icon"
|
android:icon="@drawable/icon"
|
||||||
android:label="@string/app_name" >
|
android:label="@string/app_name" >
|
||||||
@ -43,6 +45,10 @@
|
|||||||
<activity
|
<activity
|
||||||
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
|
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
|
||||||
android:name="com.google.ads.AdActivity" />
|
android:name="com.google.ads.AdActivity" />
|
||||||
|
|
||||||
|
<meta-data android:name="com.google.android.backup.api_key"
|
||||||
|
android:value="AEdPqrEAAAAIwG6zsGB4qo6ZhjfwIJpm9WI7AqmWaoRXm6ZJnA" />
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
19
src/org/fox/ttrss/PrefsBackupAgent.java
Normal file
19
src/org/fox/ttrss/PrefsBackupAgent.java
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
package org.fox.ttrss;
|
||||||
|
|
||||||
|
import android.app.backup.BackupAgentHelper;
|
||||||
|
import android.app.backup.SharedPreferencesBackupHelper;
|
||||||
|
|
||||||
|
public class PrefsBackupAgent extends BackupAgentHelper {
|
||||||
|
// The name of the SharedPreferences file
|
||||||
|
static final String PREFS = "org.fox.ttrss_preferences";
|
||||||
|
|
||||||
|
// A key to uniquely identify the set of backup data
|
||||||
|
static final String PREFS_BACKUP_KEY = "prefs";
|
||||||
|
|
||||||
|
// Allocate a helper and add it to the backup agent
|
||||||
|
@Override
|
||||||
|
public void onCreate() {
|
||||||
|
SharedPreferencesBackupHelper helper = new SharedPreferencesBackupHelper(this, PREFS);
|
||||||
|
addHelper(PREFS_BACKUP_KEY, helper);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user