Java tutorial
//package com.java2s; import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; public class Main { public static void putStringToDefault(Context context, String key, String value) { SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context); sp.edit().putString(key, value).commit(); } }