Java tutorial
//package com.java2s; import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; public class Main { private static SharedPreferences getSharedPrefs(final Context context) { return PreferenceManager.getDefaultSharedPreferences(context); } }