Java tutorial
//package com.java2s; //License from project: Open Source License import android.content.Context; import android.content.SharedPreferences; public class Main { public static final String FILE_NAME = "yht_sdk_data"; public static Boolean getBoolean(Context context, String key, Boolean defaultObject) { if (context == null) return defaultObject; SharedPreferences sp = context.getSharedPreferences(FILE_NAME, Context.MODE_PRIVATE); return sp.getBoolean(key, defaultObject); } }