Jump to content
at3s

Problem with TDirectory.GetDirectories(TPath.GetSharedPicturesPath, '*') in Android 10

Recommended Posts

Actually problem becomes in Android 10, in Android 6 I have so fine.

I just have developed a form which shows folders and files in

TPath.GetSharedPicturesPath

directory.

I have ask to grant READ_EXTERNAL_STORAGE permission for application, it is properly granted, checked in system.

But 

TDirectory.GetDirectories(TPath.GetSharedPicturesPath, '*')

returns an empty list of folders as well as 

TDirectory.GetFiles(TPath.GetSharedPicturesPath)

returns an empty list of files in Android 10.

Even I get a level up folder.

Any idea?

Share this post


Link to post
Guest

option "Secure File Sharing"

is checked?

 

http://blong.com/Articles/AndroidPermissions/DelphiAppPermissions.htm

http://docwiki.appmethod.com/appmethod/1.13/topics/en/Uses_Permissions

 

hug

Share this post


Link to post
Guest

/0 would be a "root" on mobile devices

you cannot access it

you need a folder access, like "Downloads", "Pictures", etc

 

now if you are using RAD10.4.x can be one of many bugs from this edition!

 

hug

Edited by Guest

Share this post


Link to post
2 minutes ago, emailx45 said:

/0 would be a "root" on mobile devices

you cannot access it

you need a folder access, like "Downloads", "Pictures", etc

 

hug

It makes sense. But TPath.GetSharedPicturesPath returns /storage/emulated/0/Pictures/ 

I need to be able to show pictures from device in my form.

Share this post


Link to post
Guest

please follow the links above.

search in my profile my post about use of PERMISSIONS on Android. with sources tested.

 

hug

Edited by Guest

Share this post


Link to post
10 minutes ago, emailx45 said:

please follow the links above.

search in my profile my post about use of PERMISSIONS on Android. with sources tested.

 

hug

Based on topic "Runtime permissions in Android (new in Delphi 10.3)", do you think I have to grant ACCESS_COARSE_LOCATION and ACCESS_FINE_LOCATION permissions as well?

Otherwise I do not see any differnces I already define in an application.

Share this post


Link to post
Guest

for that always detail your programming setup!

 

then, the answer can go quickly.

 

hug

Share this post


Link to post
8 hours ago, emailx45 said:

for that always detail your programming setup!

 

then, the answer can go quickly.

 

hug

I'm agree with you. But I have not any special in my project setup settings. Any newly created FMX project shall have mostly the same AndroidManifest.template.xml file. So the topic's issue shall be there as well.

Share this post


Link to post

I solved this kind of problem by removing ARM fichier de map in linker configuration, in Options/Construction/Compiler/Linker (see attached picture).

 

linker.png

Share this post


Link to post

 

I have the same problem, but now with Android 12. I give the permissions, I can save in TPath.GetSharedPicturesPath but I can't read them.

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

×