Is there a java method to find the root folder of any device (no mirco SD card)?
I need to for eg read from a folder called "books" that should be in the root folder of any android device.
Seems to me as if /storage/sdcard0/books should be inside the B4A project (and thus will get deleted when the B4A project is uninstalled - I don't want that.
On my Lollipop device it seems to be /storage/sdcard1/books (working). But this does not work on my KitKat device.
This code in the Java project does however report the root folder correctly for my S4 Mini (KitKat - /storage/sdcard0) and for my VF-795 (Lollipop - /storage/sdcard1)
But then I have to change
Dim mylist As List = File.ListFiles("/storage/sdcard1/books/general/")
to
Dim mylist As List = File.ListFiles("/storage/sdcard0/books/general/")
...in order to get to the /books folder. So it seems that when the micro SD card is present then /storage/sdcard1/books/ applies to the device's secondary storage (not the micro SD card) but when the micro SD card is removed then /storage/sdcard0/books/ applies.
I don't have the books folder on the micro SD card.
So how does one handle it in this case when an SD card is present? Is the way that this device handles File.DirRootExternal something out of the ordinary as it reports the SD card when the sd card is present but it reports the device's secondary storage when the sd card is removed?