Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; public class Main { private static final String VivaCurrentWindSpeed = "VivaCurrentWindSpeed"; public static float getVivaCurrentSpeed(Context context) { return getPreferences(context).getFloat(VivaCurrentWindSpeed, 0.0f); } /** * Default Preference Helper * @param context - the calling application context. * @return Shared Preferences */ private static SharedPreferences getPreferences(Context context) { return PreferenceManager.getDefaultSharedPreferences(context); } }