How to Request a Run Time Permission in Android

Full source code to request a READ_EXTERNAL_STORAGE permission at run time, which is necessary since Android 6.0 (Marshmallow), whereas before this permission would be granted at the installation process. For this we will use the checkSelfPermission and requestPermissions methods and show a rationale to the user at the appropriate time with the shouldShowRequestPermissionRationale method activity_main.xml … Read more