@@ -0,0 +1,1392 @@
+package com.tf.reusable.demoapplication.util;%0A%0Aimport android.app.Activity;%0Aimport android.content.Context;%0Aimport android.content.pm.PackageManager;%0Aimport android.os.Build;%0Aimport android.support.v4.app.ActivityCompat;%0Aimport android.support.v4.content.ContextCompat;%0A%0A/**%0A * Created by kamran on 8/28/16.%0A */%0A%0Apublic class PermissionHelper %7B%0A%0A    private static final int PERMISSION_REQUEST_CODE = 0;%0A%0A    public static void askForAllPermissions(Activity activity) %7B%0A        try %7B%0A            String%5B%5D permissions = activity.getPackageManager()%0A                    .getPackageInfo(activity.getPackageName(), PackageManager.GET_PERMISSIONS)%0A                    .requestedPermissions;%0A%0A            if (permissions != null) %7B%0A                askForPermission(activity, permissions);%0A            %7D%0A        %7D catch (PackageManager.NameNotFoundException e) %7B%0A            e.printStackTrace();%0A        %7D%0A    %7D%0A%0A    public static boolean isPermissionGranted(Context context, String permission) %7B%0A        return Build.VERSION.SDK_INT %3C= 22%0A                %7C%7C ContextCompat.checkSelfPermission(context, permission) == PackageManager.PERMISSION_GRANTED;%0A    %7D%0A%0A    public static void askForPermission(Activity activity, String... permissions) %7B%0A        if (Build.VERSION.SDK_INT %3E= 22) %7B%0A            ActivityCompat.requestPermissions(activity, permissions, PERMISSION_REQUEST_CODE);%0A        %7D%0A    %7D%0A%7D%0A

Add a permission handler to help handle permissions on runtime