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