Java tutorial
//package com.java2s; import android.content.Context; import android.content.SharedPreferences; public class Main { private static final String STORE_NAME = "TestStore"; private static final String STORE_KEY_PREFIX = "TESY_STORE_"; public static void storeInteger(Context context, String key, int value) { SharedPreferences pre = context.getSharedPreferences(STORE_NAME, Context.MODE_APPEND); pre.edit().putInt(STORE_KEY_PREFIX + key, value).commit(); } }