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 float readFloat(Context context, String key, float defaultValue) { SharedPreferences pre = context.getSharedPreferences(STORE_NAME, Context.MODE_PRIVATE); return pre.getFloat(STORE_KEY_PREFIX + key, defaultValue); } }