Java tutorial
//package com.java2s; import android.content.Context; import android.content.pm.PackageManager; public class Main { public static final boolean hasExternalStoragePermission(Context context) { int perm = context.checkCallingOrSelfPermission("android.permission.WRITE_EXTERNAL_STORAGE"); return perm == PackageManager.PERMISSION_GRANTED; } }