Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; import android.content.pm.PackageManager; public class Main { private static Context mContext; private static final String EXTERNAL_STORAGE_PERMISSION = "android.permission.WRITE_EXTERNAL_STORAGE"; private static boolean hasExternalStoragePermission() { int perm = mContext.checkCallingOrSelfPermission(EXTERNAL_STORAGE_PERMISSION); return perm == PackageManager.PERMISSION_GRANTED; } }