Java tutorial
//package com.java2s; import android.content.Context; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; public class Main { private static final String SP_NAME = "bp_sp_storage"; public static void putFloat(Context context, String key, float value) { SharedPreferences sp = context.getApplicationContext().getSharedPreferences(SP_NAME, Context.MODE_PRIVATE); Editor editor = sp.edit(); editor.putFloat(key, value); editor.commit(); } }