Java tutorial
//package com.java2s; import android.content.Context; import android.content.SharedPreferences; public class Main { private static String FILE_NAME = "WasCopy"; public static final String CAMERA_ACTIVE = "cameraActive"; public static boolean getCameraActive(Context context) { SharedPreferences sd = context.getSharedPreferences(FILE_NAME, Context.MODE_PRIVATE); return sd.getBoolean(CAMERA_ACTIVE, false); } }