Jump to content
rebotea

Adroid WRITE_EXTERNAL_STORAGE Delphi 12.3

Recommended Posts

Any help on how to implement permision to make folder if not exist and save files since now i`m not able to do that in  Delphi 12.3  

before in form create i have

 PermissionsService.RequestPermissions(['android.permission.READ_EXTERNAL_STORAGE', 'android.permission.WRITE_EXTERNAL_STORAGE','android.permission.CAMERA'],
    procedure(const APermissions: TArray<string>; const AGrantResults: TArray<TPermissionStatus>)
    begin
 

    end
  );

Share this post


Link to post
8 minutes ago, rebotea said:

Any help on how to implement permision to make folder if not exist and save files since now i`m not able to do that in  Delphi 12.3  

I expect it's not Delphi 12.3 that's the problem, but the version of Android on the device that you're running the app on. See here

It would help to know the location of the folder you're trying to create.

  • Like 1

Share this post


Link to post

Here is part of the code!

 

 function CaminhoRaiztelm: string;
var MusicPathLength: integer;
    MusicPath, SDCardPath: string;

begin
  MusicPath:=TPath.GetSharedMusicPath;
  MusicPathLength:=Length(MusicPath);
  SDCardPath:=Copy(MusicPath, 0, MusicPathLength-5);
  Result:=SDCardPath;
end;

 

PastaGrava:= trim (CaminhoRaiztelm+'Man');
    ForceDirectories(PastaGrava);

 

     try
      rs := TResourceStream.Create(HInstance,'Resource_2',RT_RCDATA);

         FileName1:=  (PastaGrava+'/Defeito.pdf') ;
 if FileExists(fileName1)   then
  else
   rs.SaveToFile(FileName1);

      rs.Free;

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

×