Java tutorial
//package com.java2s; import android.content.Context; import android.content.SharedPreferences; public class Main { public static final String XL_PREFERENCES = "joy_xl"; public static void saveLoginUserPasswd(Context context, String loginUserPasswd) { SharedPreferences.Editor localEditor = context.getSharedPreferences(XL_PREFERENCES, Context.MODE_PRIVATE) .edit(); localEditor.putString("loginUserPasswd", loginUserPasswd); localEditor.commit(); } }