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 void setCameraActive(Context context, boolean fl) { SharedPreferences sd = context.getSharedPreferences(FILE_NAME, Context.MODE_PRIVATE); SharedPreferences.Editor editor = sd.edit(); editor.putBoolean(CAMERA_ACTIVE, fl); editor.commit(); } }