Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; import android.content.SharedPreferences; public class Main { public static final String CVALUE = "cvalue"; public static final String USERPIC = "userpic"; public static void putUserPic(Context context, String city) { SharedPreferences preferences = context.getSharedPreferences(USERPIC, Context.MODE_PRIVATE); preferences.edit().putString(CVALUE, city).commit(); } }