Java tutorial
//package com.java2s; import android.content.Context; import android.content.SharedPreferences; public class Main { public static final String PREFS_KEY_PASSCODE = "prefs_key_passcode"; public static boolean isCorrectPasscode(Context context, String inputPasscode) { SharedPreferences prefs = context.getSharedPreferences(context.getPackageName(), Context.MODE_PRIVATE); if (prefs.getString(PREFS_KEY_PASSCODE, null).contentEquals(inputPasscode)) return true; else return false; } }