Java tutorial
//package com.java2s; import android.content.Context; import android.content.SharedPreferences; public class Main { public static void saveSettingValue(Context context, String path, String key, String value) { saveValue(context, context.getSharedPreferences(path, 0), key, value); } public static void saveValue(Context context, SharedPreferences sp, String key, String value) { sp.edit().putString(key, value).commit(); } }