Mike1970

Well-Known Member
Licensed User
Longtime User
Hi everyone,
I'm trying to download a file from a server, and I want to save it in the "Download" folder of the phone (not on an external SD or USB)
what is the right way to do it?

(I already know how to download... i need to specify only the path)

I tried with RuntimePermission.GetSafeDirDefaultExternal("") but it returns:
/storage/emulated/0/Android/data/<app-package-name>/files

thanks to a File Manager app, i know that the path for the "Download" folder in the Internal Memory of the phone is:
/storage/emulated/0/Download

Screenshot_20220617_140920_com.huawei.hidisk.jpg
--->
Screenshot_20220617_140924_com.huawei.hidisk.jpg


Thanks in advance
 
Solution
You are not the first person to ask this question on the forum, although you might be the first to ask it this week.

If you need to use the current Android version (eg you are writing for the PlayStore) then you can only save files directly to internal storage. To save them anywhere else you must involve the User and let them choose where to save the file - you cannot force them to choose "Download" for instance. This link explains all.

If the app is for your own use, or will not go in the Playstore, then you can use a downlevel Android version (29 or earlier I think) and then it will be just like old times.

If you are wondering how your "File Manager" app manages to access the "Download" folder, that is because the developers...

Brian Dean

Well-Known Member
Licensed User
Longtime User
You are not the first person to ask this question on the forum, although you might be the first to ask it this week.

If you need to use the current Android version (eg you are writing for the PlayStore) then you can only save files directly to internal storage. To save them anywhere else you must involve the User and let them choose where to save the file - you cannot force them to choose "Download" for instance. This link explains all.

If the app is for your own use, or will not go in the Playstore, then you can use a downlevel Android version (29 or earlier I think) and then it will be just like old times.

If you are wondering how your "File Manager" app manages to access the "Download" folder, that is because the developers negotiated with Google to convince them that they were producing a fully functioning storage management utility that would be an asset to the Playstore.
 
Upvote 0
Solution

Mike1970

Well-Known Member
Licensed User
Longtime User
I was ended exactly here for the Plan B


If you are wondering how your "File Manager" app manages to access the "Download" folder, that is because the developers negotiated with Google to convince them that they were producing a fully functioning storage management utility that would be an asset to the Playstore.
Ouhhh ok, that's exactly what I was thinking before... "if the File Manager can do that.. well i can too.." - Nope
thanks for this explanation :D
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
"if the File Manager can do that.. well i can too.."
You can but Google only allows certain type of Play Store app to access the entire file store.
If it is for your own use then there is no problem/
 
Upvote 0
Top