Java tutorial
//package com.java2s; import android.content.Context; public class Main { private static final String a[] = { "android.permission.ACCESS_COARSE_LOCATION" }; public static boolean hasGetCurrentServingCellPermission(Context context) { String as[] = a; int i = as.length; for (int j = 0; j < i; j++) { if (context.checkCallingOrSelfPermission(as[j]) != 0) { return false; } } return true; } }