Requesting permission in run time in Android

If we are making an app for Android greater than SDK 23, we need to request some sensitive permissions (for example, to write file in external storage) in run time.

Here is a snippet to do so:

if (Build.VERSION.SDK_INT >= 23) {
	if (checkSelfPermission(android.Manifest.permission.WRITE_EXTERNAL_STORAGE)
			== PackageManager.PERMISSION_GRANTED) {
	} else {

		ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1);


Getting boored? Why not playing a game?

Power Block

Tiki Solitaire

Pet Connect

Cake Shop

Jewels Blitz 3

Forest Match

Bike Racing


Solitaire Swift

Bubble Shooter Classic HD

Black and white snake

Leave a Reply

Your email address will not be published. Required fields are marked *