Java tutorial
//package com.java2s; import android.content.Context; import android.content.SharedPreferences; public class Main { private static final String SHARED_NAME = "SharedPreferences"; public static float getFloat(Context context, String key, float defValue) { SharedPreferences sp = getSharedPreferences(context); return sp.getFloat(key, defValue); } private static SharedPreferences getSharedPreferences(Context context) { return context.getSharedPreferences(SHARED_NAME, Context.MODE_PRIVATE); } }