Java tutorial
//package com.java2s; import android.content.Context; import android.content.SharedPreferences; public class Main { /** The name of the shared preferences file */ private static final String PREFERENCES_NAME = "muslimCompanionPrefs"; private static final String NOTIFY_PRAYER = "notifyPrayer"; public static boolean getNotifyPrayer(Context context) { SharedPreferences sharedPreferences = context.getSharedPreferences(PREFERENCES_NAME, Context.MODE_PRIVATE); return sharedPreferences.getBoolean(NOTIFY_PRAYER, true); } }