Android Question Saving a file to a folder you create

dieterp

Active Member
Licensed User
Longtime User
I have an activity page in my app that the user can take a screenshot of and then save the image in a folder on their device (That they can then go view whenever they want). It all worked fine (Using MakeDir) but with all the user permissions and new stuff coming in it is no longer working (Been a while since I checked this functionality so not sure when it stopped working).

I'd like to know the best solution is to fix it now. I see Erel posted the SaveAs method, but I'm not sure if this method will allow the user to access the file themselves. I'd also like to know what I'd need to add to the manifest editor. At some point I had to remove "android.permission.WRITE_EXTERNAL_STORAGE" from the manifest editor to get something else to work, but I can't exactly remember what. Sorry if my explanation is a bit vague but I've been in and out of updating the app over the years so have battled to keep up
 

dieterp

Active Member
Licensed User
Longtime User
I did read through that but I'm not sure if the user will be able access the file under File.DirInternal? If I change that to File.DirDefaultExternal then I'm not sure what permissions it could entail, and if I need to bring "android.permission.WRITE_EXTERNAL_STORAGE" back into the manifest editor (And what it might break if I do)
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
Erel said:
Note that you should avoid using File.DirDefaultExternal

Erel said:

Note that you should avoid using File.DirDefaultExternal and use RuntimePermissions.GetSafeDirDefaultExternal instead (read about it in the runtime permissions tutorial).
File.DirInternal should be the default location for most files.

Note that you should avoid using File.DirDefaultExternal and use RuntimePermissions.GetSafeDirDefaultExternal instead (read about it in the runtime permissions tutorial).
 
Upvote 0
Top