Android Question XUI.DefaultFolder vs rp.GetSafeDirDefaultExternal("") not finding files that are there

Robert Valentino

Well-Known Member
Licensed User
Longtime User
I know it is probably something dumb I am doing wrong but I am trying to convert all my code that is using runtimepermissions.GetSafeDirDefaultExternal
to use xui.defaultfolder (reason for the convert is so I can get this app to work on B4i)

Now they are suppose to point to the same thing but when I print them out
B4X:
XUI.DefaultFolder[/data/user/0/com.BOBs.BBsViewer/files]  
RuntimePermissions.GetSafeDirDefaultExternal[/storage/emulated/0/Android/data/com.BOBs.BBsViewer/files]
The above seems like they should be the same location but when I use File.Exists(xui.DefaultFolder, <somefile name>) I am told it does not exists
But if I use File.Exists(rp.GetSafeDirDefaultExternal(""), <somefile name>) it says the file exist.

How do I swap from using rp.getsafedirdefaultexternal to xui.defaultfolder but yet find the files properly

BobVal
 

Mahares

Expert
Licensed User
Longtime User
The above seems like they should be the same location but when I use File.Exists(xui.DefaultFolder, <somefile name>) I am told it does not exists
xui,defaultfolder and rp.GetSafeDirDefaultExternal("") are totally different from each other. You need to copy them from rp....to xui.defaultfolder
xui.defaultfolder is the same as file.DirInternal. Then you need to change your code references from rp..... to xui.defaultfolder. It is not automatic.
 
Upvote 2

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Thanks, was hoping I was missing something (well I am but that's a different problem)

I've really been out of it.
I use to use File.DirRootExternal, when that became a no, no I thought we were suppose to use rp.GetSafeDirDefaultExternal("") and now we are suppose to use xui.defaultfolder. Oh well I will make a move files routine

Again thanks
 
Upvote 0
Top