Accessing SD card files and directories in Android?

4.4.1

So, I’m trying to access directories and files on the SD card on Android, I was hoping that with the native file dialog finally making its way onto 4.4 this would be easier, since the old FileDialog was a bit cumbersome ( and I think it was glitched when trying to access the External Memory/SD card? not really sure).

However, whenever I want to access a file on the SD card, the directory always seems to point towards the internal memory of the Android device (at least from what I tested) I have made a small and quick example of what I’m referring to on my github where you can see the issue:

The project is pretty straightforward; the project consists of a button and a label, pressing the button will open the native file picker depending on the OS, so it can also be tested on Windows. This file picker will only let you pick a directory. Upon selecting any directory, the label will be updated with the path and a list of files and directories found on the directory you picked.

To test the behavior I’m talking about, add Android to the exports and check Manage External Storage and Read External Storage, once that’s done you can test it on your Android device.

The expected behavior would be that upon selecting a directory inside the SD card, it would list the correct directory and files/dirs inside of the SD card, however, it defaults back to the Internal Memory, often causing an error if the Internal and External memory do not share the same exact dir. If they do, the program will take the dir and contents found on the Internal memory.

There is just a single script that is pretty straightforward, handling the opening of the File Dialog and ask for permissions and updating the label.

I have already set Manage External Storage, Read External Storage and Write External Storage permissions, as well as using OS.request_permissions() on the function that fires the open file dialog and the function _on_file_dialog_dir_selected() but alas, the problem persists.

So I am wondering, is this the expected behavior, is access to external storage still limited? or am I missing or understanding something wrong and if so, could anyone point me into the right direction?