Java tutorial
//package com.java2s; import android.content.Context; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.preference.PreferenceManager; public class Main { public static void setLogText(Context context, String text) { SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context); Editor editor = sp.edit(); editor.putString("log_text", text); editor.commit(); } }