Hello,
I am making a very simple directory chooser. So far all works fine an I can access internal memory and the SD card. There is just one little thing bugging me.
When getting all the available storage devices with "For Each s As String In rp.GetAllSafeDirsExternal("")" then I get the internal memory and SD card paths appended with the app's file path. That means "/storage/emulated/0/Android/data/b4a.example/files" for the internal and "/storage/1234-1234/Android/data/b4a.example/files" for SD card. I can access both paths up to the ""/storage/emulated/0/" and "/storage/1234-1234/". Now the question is if it is safe to presume that all paths will always include the "/Android/" part. If so I could simply cut the paths of from "Android/" on and have my valid top level paths. Or could it be on different devices that these paths could be anything else? Or can I compare the paths and cut all folders that match from the bottom up?
What would be the safest way to get the top level folders?
I am making a very simple directory chooser. So far all works fine an I can access internal memory and the SD card. There is just one little thing bugging me.
When getting all the available storage devices with "For Each s As String In rp.GetAllSafeDirsExternal("")" then I get the internal memory and SD card paths appended with the app's file path. That means "/storage/emulated/0/Android/data/b4a.example/files" for the internal and "/storage/1234-1234/Android/data/b4a.example/files" for SD card. I can access both paths up to the ""/storage/emulated/0/" and "/storage/1234-1234/". Now the question is if it is safe to presume that all paths will always include the "/Android/" part. If so I could simply cut the paths of from "Android/" on and have my valid top level paths. Or could it be on different devices that these paths could be anything else? Or can I compare the paths and cut all folders that match from the bottom up?
What would be the safest way to get the top level folders?