Android Question How is it that we do not have this runtime permission on B4A?

Mehrzad238

Active Member
Starting from Android 10 (API 29) and Android 14 (API 34), there are changes in how storage and media permissions work.

Android 14 (API 34) Changes

Google introduced scoped storage and separate media permissions, meaning:

  1. READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE are no longer used for general file access.
  2. Instead, Android 13+ uses separate permissions for photos, videos, and audio.

B4X:
    ' Request Photo & Video Permissions (Android 13+)
    rp.CheckAndRequest(rp.PERMISSION_READ_MEDIA_IMAGES)
    rp.CheckAndRequest(rp.PERMISSION_READ_MEDIA_VIDEO)
    
    ' Request Audio File Access (Android 13+)
    rp.CheckAndRequest(rp.PERMISSION_READ_MEDIA_AUDIO)

@Erel will you do something about this?
 
Solution
No offense taken. If you have a question then post the question. No need to ask me what I will do about it.

What is the question? You can request any permission you like.
B4X:
 rp.CheckAndRequest("any string will work here")

LucaMs

Expert
Licensed User
Longtime User
What is the question? You can request any permission you like.
He was asking you if you could (please?) add those constants to RuntimePermissions.


@Mehrzad238, constants are convenient but not essential, you can search in the Android documentation what values you need to pass.

1739427943488.png


This should work:
    ' Request Photo & Video Permissions (Android 13+)
    rp.CheckAndRequest("android.permission.READ_MEDIA_IMAGES")
 
Upvote 0
Top