Android Open Source - MythTrack Myth Track Backup






From Project

Back to project page MythTrack.

License

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.

Java Source Code

/**
 * 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);
  }

}




Java Source Code List

nolanjurgens.mythtrack.app.BuyItemDialog.java
nolanjurgens.mythtrack.app.CreateHeroDialog.java
nolanjurgens.mythtrack.app.DeleteHeroDialog.java
nolanjurgens.mythtrack.app.EquipmentInfoDialog.java
nolanjurgens.mythtrack.app.HeroDisplayFragment.java
nolanjurgens.mythtrack.app.HeroHelper.java
nolanjurgens.mythtrack.app.HeroList.java
nolanjurgens.mythtrack.app.HeroTrackerActivity.java
nolanjurgens.mythtrack.app.Hero.java
nolanjurgens.mythtrack.app.InventoryList.java
nolanjurgens.mythtrack.app.ItemHelper.java
nolanjurgens.mythtrack.app.ItemList.java
nolanjurgens.mythtrack.app.Item.java
nolanjurgens.mythtrack.app.MainActivity.java
nolanjurgens.mythtrack.app.RemoveItemDialog.java
nolanjurgens.mythtrack.app.SettingsActivity.java
nolanjurgens.mythtrack.app.SettingsFragment.java
nolanjurgens.mythtrack.app.StatInfoDialog.java
nolanjurgens.mythtrack.app.StatPickerDialog.java
nolanjurgens.mythtrack.app.TitleHelper.java
nolanjurgens.mythtrack.app.Title.java
nolanjurgens.mythtrack.provider.MythTrackBackup.java
nolanjurgens.mythtrack.provider.MythTrackContract.java
nolanjurgens.mythtrack.provider.MythTrackDatabase.java