Java tutorial
//package com.java2s; //License from project: Open Source License import android.content.Context; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; public class Main { private final static String CONFIG_FILE_NAME = "app_config"; public static void set(Context context, String key, String value) { SharedPreferences preferences = context.getSharedPreferences(CONFIG_FILE_NAME, Context.MODE_PRIVATE); Editor editor = preferences.edit(); editor.putString(key, value); editor.commit(); } }