Android examples for Android OS:SharedPreferences
set key value pair to SharedPreferences
//package com.java2s; import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; public class Main { private static final String REDU_PIN_CODE = "REDU_PIN_CODE"; public static boolean set(Context context, String pinCode) { return getPrefs(context).edit().putString(REDU_PIN_CODE, pinCode) .commit();/*w w w . j a v a2 s. c om*/ } private static SharedPreferences getPrefs(Context context) { return PreferenceManager.getDefaultSharedPreferences(context); } }