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 storeLong(Context context, String key, long value) { SharedPreferences pre = context.getSharedPreferences(STORE_NAME, Context.MODE_PRIVATE); pre.edit().putLong(STORE_KEY_PREFIX + key, value).commit(); } }