Wish Needed Additions to "File"

mjtaryan

Active Member
Licensed User
Longtime User
Beginning with Android 4.x (I think) changes appear to have been made to the handles used by the OS to identifiy the locations of files such that devices (at least in my experience) result in b4a returning erroneous data when the methods "DirDefaultExternal" and "DirRootExternal" are used. With earlier Android versions these methods returned the paths to the removable SD card (default directory and the root directory respectively). However, since ICS this is no longer true. What is returned is actually non-removable storage referred to as "sdcard0" which is actually internal. The removable media appears now to be referenced by "extSdCard".

Consequently, two additional methods are highly desirable and even urgently needed that perform the same functions as those mentioned above, but specifically target the removable media. I would suggest the following names for these methods:

DirDefaultRemovable (equivalent to DirDefaultExternal)
DirRootRemovable (equivalent to DirRootExternal)

In fact, might it not be possible to make a pair of combination methods called

DirDefault(Location As Int) As String
DirRoot(Location As Int) As String

The possible valid values for Location would be something like 0 (Internal), 1 (External) and 2 or >2 (Removable - values greater than 2 would refer to more than a single removable media slot if devices ever have them. Values > than perhaps 6 would refer to USB storage such as a thumb drive). Just an idea offered for consideration.

I urge these additions be incorporated into the next B4a update. Thanks Erel.
 
Top