Access to folders

Sergey_New

Well-Known Member
Licensed User
Longtime User
Some file managers (for example File Manager Plus) from Google Play have access to the download folder of Android 14 devices. How is this possible?
Everyone is equal before God Google. But some are more equal than others.
My app wants this too :)
 

Star-Dust

Expert
Licensed User
Longtime User
Some file managers (for example File Manager Plus) from Google Play have access to the download folder of Android 14 devices. How is this possible?
Everyone is equal before God Google. But some are more equal than others.
My app wants this too :)
The pre-installed apps are compiled with the super-USER or administrator keys.
Some apps, such as antivirus and file manager, have requested permission from Google to use a special library that gives you access to all folders. You can also use it if you don't have to publish on Google Play, in case you want to publish it you have to ask for a special permit.

This question has been asked several times. If you are looking for the good answers in the forum you will find everything you need and avoid filling the repetition forum
 

Sergey_New

Well-Known Member
Licensed User
Longtime User
This question has been asked several times.
That's true. That's why I'm writing in this section. But I still haven't received a clear answer.
 

josejad

Expert
Licensed User
Longtime User
I still haven't received a clear answer

You got it
The pre-installed apps are compiled with the super-USER or administrator keys.
Some apps, such as antivirus and file manager, have requested permission from Google to use a special library that gives you access to all folders. You can also use it if you don't have to publish on Google Play, in case you want to publish it you have to ask for a special permit.
 

Sergey_New

Well-Known Member
Licensed User
Longtime User
You got it
No, I didn't understand how to get a special permit. My application is simply not accepted. That's why I cited the proverb in the first post.
 

DonManfred

Expert
Licensed User
Longtime User
No, I didn't understand how to get a special permit.
You DO NOT get any permissions for this folder.
The only way is to use Contentchooser and

- maybe - it is possible with the FileAccessFramework behind
Edit: It does not work with the External Storage Class. You sinply can not choose the Rootfolder and even not the Downloadfolder directly.

I i fear you´ll not get more options.
Especially if you want to publish the app in Google PlayStore.
 
Last edited:

josejad

Expert
Licensed User
Longtime User
If you want to publish your app, then you must get permission from Google for using a special library to get access to all folders. Google doesn't allow to access all paths for security reasons from Android 10 (api 29).
If you don't need to publish your app in Google Play, then you can set your API to lower versions and then use some of the methods explained in the forum.
 
Last edited:

josejad

Expert
Licensed User
Longtime User
access to the download folder of Android 14 devices. How is this possible?
 

Star-Dust

Expert
Licensed User
Longtime User
No, I didn't understand how to get a special permit. My application is simply not accepted. That's why I cited the proverb in the first post.
You can publish an app on Google Play that requires the MANAGE_EXTERNAL_STORAGE permission, but there are very strict restrictions and guidelines that you must follow. Google Play has implemented stringent policies to limit the use of this permission to specific and justified cases only.

If you do not publish your app on Google Play, you can use the MANAGE_EXTERNAL_STORAGE permission without having to comply with the restrictions imposed by Google.
 

mcqueccu

Expert
Licensed User
Longtime User
I believe you can have this permission and also upload your app to the play store ONLY IF, the app basic functionality depends on it.

Like someone says, An Antivirus app that needs to scan your phone or a
File Manager that needs to analyze your folders, etc basically needs this permission.

I am working on a sample code on which permissions to use and hopefully by 24th March, I will post the full example
 

mcqueccu

Expert
Licensed User
Longtime User
Yes, you can publish an app on Google Play that requires the MANAGE_EXTERNAL_STORAGE permission, but there are very strict restrictions and guidelines that you must follow. Google Play has implemented stringent policies to limit the use of this permission to specific and justified cases only.

Yes, if you do not publish your app on Google Play, you can use the MANAGE_EXTERNAL_STORAGE permission without having to comply with the restrictions imposed by Google.
Exactly
 

Star-Dust

Expert
Licensed User
Longtime User
Summary:

  • Access to shared files: Use the Storage Access Framework (SAF) to allow the user to select files or folders.
  • Access to media files: Use the MediaStore API to access photos, videos, and audio.
  • Full access (with limitations): Use MANAGE_EXTERNAL_STORAGE if necessary, but only for specific use cases. (Special permission from Google is required for publishing.)
 

Sergey_New

Well-Known Member
Licensed User
Longtime User
This is what is written above, I know and have already read earlier on the forum. It is simply very surprising that it is impossible to create an application in which the user must place the text files he needs in the download folder, and the application will be able to read them and give the desired results. It is good that with media files, which are also needed, this is possible.
Thanks to everyone for participating in the conversation.
 

mcqueccu

Expert
Licensed User
Longtime User

Sergey_New

Well-Known Member
Licensed User
Longtime User
mcqueccu, thanks!
You get a list of folders.
And I need to read the files in the download folder.
 

DonManfred

Expert
Licensed User
Longtime User
You get a list of folders.
And I need to read the files in the download folder.
What stops you from getting the foldercontent?

change

B4X:
    Wait For (File.ListFilesAsync(File.DirRootExternal)) Complete (Success As Boolean, Files As List)

to

B4X:
Wait For (File.ListFilesAsync(File.Combine(File.DirRootExternal,"Download"))) Complete (Success As Boolean, Files As List)
 
Top