Jump to content
Maher Tannous

Android 13 ( 64-bit ) storage permission problem

Recommended Posts

I have a problem with phones running on Android 13 ( 64-bit )
I am using Delphi 11.3 and Android sdk with api 34 and MobilePermissions Component
MobilePermissions
The problem is that the storage permission does not work in Android 13 (64-bit), while it works on Android 11 and 12 (64-bit).

Any help please

Share this post


Link to post

I solved my problem with this code
 

{$IF DEFINED(ANDROID)}
var
  imagee, videoo, audioo, state, read, write, camera: string;
{$ENDIF}
begin
{$IFDEF ANDROID}
  state := JStringToString(TJManifest_permission.JavaClass.Read_phone_state);
  camera := JStringToString(TJManifest_permission.JavaClass.camera);
  read := JStringToString
    (TJManifest_permission.JavaClass.READ_EXTERNAL_STORAGE);
  write := JStringToString
    (TJManifest_permission.JavaClass.WRITE_EXTERNAL_STORAGE);
  if JStringToString(TJBuild_VERSION.JavaClass.RELEASE) = '13' then
  Begin
    imagee := JStringToString
      (TJManifest_permission.JavaClass.READ_MEDIA_IMAGES);
    videoo := JStringToString(TJManifest_permission.JavaClass.READ_MEDIA_VIDEO);
    audioo := JStringToString(TJManifest_permission.JavaClass.READ_MEDIA_AUDIO);
    PermissionsService.requestPermissions([state, camera, imagee, videoo,
      audioo, read, write], nil, nil);
  End
  else
    PermissionsService.requestPermissions([state, camera, read, write],
      nil, nil);
{$ENDIF}

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×