Android Open Source - Replica-Jump Preferences






From Project

Back to project page Replica-Jump.

License

The source code is released under:

GNU General Public License

If you think the Android project Replica-Jump 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.vinicius.dsl.replicajump.util;
// w w w  .  j  a  v a  2  s . c om
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

public class Preferences {
     private static String name = "Geo";
     public static void putString(String tag,String valor,Context contexto){
       SharedPreferences pref = contexto.getSharedPreferences(name, Context.MODE_PRIVATE);
       Editor edit = pref.edit();
       edit.putString(tag, valor);
       edit.commit();
     }
     public static void putInt(String tag,int valor,Context contexto){
         SharedPreferences pref = contexto.getSharedPreferences(name, Context.MODE_PRIVATE);
         Editor edit = pref.edit();
         edit.putInt(tag, valor);
         edit.commit();
       }     
     public static void putBoolean(String tag,boolean valor,Context contexto){
         SharedPreferences pref = contexto.getSharedPreferences(name, Context.MODE_PRIVATE);
         Editor edit = pref.edit();
         edit.putBoolean(tag, valor);
         edit.commit();
       }
     public static String getString(String tag,Context contexto){
       SharedPreferences pref = contexto.getSharedPreferences(name, Context.MODE_PRIVATE);
       return pref.getString(tag, "nulo");
     }
     public static int getInt(String tag,Context contexto){
       SharedPreferences pref = contexto.getSharedPreferences(name, Context.MODE_PRIVATE);
       return pref.getInt(tag, 0);
     }
     public static boolean getBoolean(String tag,Context contexto){
       SharedPreferences pref = contexto.getSharedPreferences(name, Context.MODE_PRIVATE);
       return pref.getBoolean(tag, false);
     }
     
}




Java Source Code List

com.vinicius.dsl.replicajump.CustomCamera.java
com.vinicius.dsl.replicajump.ReplicaJumpActivity.java
com.vinicius.dsl.replicajump.level.Level1.java
com.vinicius.dsl.replicajump.level.LevelObject.java
com.vinicius.dsl.replicajump.manager.GameManager.java
com.vinicius.dsl.replicajump.manager.ResourceManager.java
com.vinicius.dsl.replicajump.manager.SceneManager.java
com.vinicius.dsl.replicajump.scene.LevelScene.java
com.vinicius.dsl.replicajump.scene.MainMenuScene.java
com.vinicius.dsl.replicajump.sprite.AndroidSprite.java
com.vinicius.dsl.replicajump.sprite.CoinGreen.java
com.vinicius.dsl.replicajump.sprite.CoinYellow.java
com.vinicius.dsl.replicajump.sprite.Enemy1.java
com.vinicius.dsl.replicajump.sprite.Enemy2.java
com.vinicius.dsl.replicajump.sprite.Enemy3.java
com.vinicius.dsl.replicajump.sprite.EnemyLarge.java
com.vinicius.dsl.replicajump.util.BasicScene.java
com.vinicius.dsl.replicajump.util.Constants.java
com.vinicius.dsl.replicajump.util.Preferences.java