How to use function "requestPermissions(.....)" on Android API Level 20

Hi all,
I want to request permission storage on runtime to fix bug on fw 6.x.x
I have just done for check this permission is grant or not. For “not” case, I got errors with some lines below

> requestPermissions(......);

@Override
onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults)

I used cocos2dx v2.2.3 and esclipse to build. Because of some reasons. I can’t use android API level 21 and above to build. Here is errors when I checked & applied high api level (>= 21)

Parsing Data for android-21 failed
Unsupported major.minor version 51.0

Current android api level I used : android api level 20

For errors of requestPermissions…, I know it only supported by android api level 23 and above.

How to fix this error on android api level 20? Import file, import jar ???

Please help me ^^!

Detailed explanation here Runtime Permissions: Best Practices and How to Gracefully Handle Permission Removal

1 Like

#if (TARGET_API_LEVEL >= 23)
if (checkSelfPermission(android.Manifest.permission.WRITE_EXTERNAL_STORAGE) != PERMISSION_GRANTED)
{
requestStoragePermission();
}
}
#endif
I just ask “google” for a few demo code. Same as I must upgrade & use android api level 23 to build.