Android Open Source - Snake Snake Backup






From Project

Back to project page Snake.

License

The source code is released under:

GNU General Public License

If you think the Android project Snake 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

package com.nickeyre.snake;
//  w w w  .j  a v a  2s .com
import android.annotation.TargetApi;
import android.app.backup.BackupAgentHelper;
import android.app.backup.SharedPreferencesBackupHelper;
import android.os.Build;

/**
 * Created by neyre on 5/16/13.
 * Backup app settings using Android Backup Service
 */

@TargetApi(Build.VERSION_CODES.FROYO)
public class SnakeBackup extends BackupAgentHelper {
    // The name of the SharedPreferences file
    static final String PREFS = "settings";

    // A key to uniquely identify the set of backup data
    static final String PREFS_BACKUP_KEY = "settings";

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




Java Source Code List

com.nickeyre.snake.GameScreen.java
com.nickeyre.snake.Game.java
com.nickeyre.snake.OptionsScreen.java
com.nickeyre.snake.SnakeBackup.java
com.nickeyre.snake.TitleScreen.java