@@ -0,0 +1,1459 @@
+import android.content.Context;%0Aimport android.content.SharedPreferences;%0Aimport android.content.SharedPreferences.Editor;%0A%0A/**%0A * %E6%9C%89%E5%85%B3 sharedPerference%E7%9A%84%E5%B7%A5%E5%85%B7%E7%B1%BB%0A * %0A * @author yemeng%0A * %0A */%0Apublic class SpUtil %7B%0A%09private static final String NAME = %22APPName%22;%0A%09private static SharedPreferences sp = MyApplication.application%0A%09%09%09.getSharedPreferences(NAME, Context.MODE_PRIVATE);%0A%0A%09// set%E6%96%B9%E6%B3%95%0A%09public static void setStringSharedPerference(String key, String value) %7B%0A%09%09Editor editor = sp.edit();%0A%09%09editor.putString(key, value);%0A%09%09editor.commit();%0A%09%7D%0A%0A%09public static void setIntSharedPerference(String key, int value) %7B%0A%09%09Editor editor = sp.edit();%0A%09%09editor.putInt(key, value);%0A%09%09editor.commit();%0A%09%7D%0A%0A%09public static void setLongSharedPerference(String key, Long value) %7B%0A%09%09Editor editor = sp.edit();%0A%09%09editor.putLong(key, value);%0A%09%09editor.commit();%0A%09%7D%0A%0A%09public static void setBooleanSharedPerference(String key, boolean value) %7B%0A%09%09Editor editor = sp.edit();%0A%09%09editor.putBoolean(key, value);%0A%09%09editor.commit();%0A%09%7D%0A%0A%09// get%E6%96%B9%E6%B3%95%0A%09public static String getStringSharedPerference(String key, String value) %7B%0A%09%09return sp.getString(key, value);%0A%09%7D%0A%0A%09public static int getIntSharedPerference(String key, int value) %7B%0A%09%09return sp.getInt(key, value);%0A%09%7D%0A%0A%09public static long getLongSharedPerference(String key, long value) %7B%0A%09%09return sp.getLong(key, value);%0A%09%7D%0A%0A%09public static boolean getBooleanSharedPerference(String key, boolean value) %7B%0A%09%09return sp.getBoolean(key, value);%0A%09%7D%0A%7D%0A

Create SpUtil.java