Java tutorial
//package com.java2s; import android.content.Context; import android.content.SharedPreferences; public class Main { public static String getString(Context context, String key) { SharedPreferences sp = context.getSharedPreferences(key, Context.MODE_PRIVATE); String value; value = sp.getString(key, ""); return value; } }