Java tutorial
//package com.java2s; import android.Manifest; import android.content.Context; import android.content.pm.PackageManager; import android.os.Process; public class Main { public static boolean checkPermission(Context context) { return context.checkPermission(Manifest.permission.CAMERA, Process.myPid(), Process.myUid()) == PackageManager.PERMISSION_GRANTED; } }