Accessing the @usr$ folder in Android

Discussions specifically related to the Android and iOS editions of BBCSDL
Hated Moron

Accessing the @usr$ folder in Android

Post by Hated Moron »

It was always the intention that the @usr$ folder should be accessible from an Android File Manager, just as it is in iOS from the Files app, allowing files to be transferred between BBC BASIC and other apps.

This was indeed the case up to and including Android 10 ('Quince Tart') but from Android 11 ('Red Velvet Cake') onwards this access has been blocked (on some devices anyway) for 'security reasons'.

I have been sent these instructions for working around this limitation; they are a little involved but better than nothing. If I can devise a better method for a future release I will of course do so:
  • Go into Settings... Apps... App management and give BBC BASIC permission to access media files (Music, Photos and Videos).
  • Open BBC BASIC and enable listing of all file types (Long press below the list of files and tap on List all files).
  • Tap on @usr$ and then tap .. four times, this should take you to the root of the file system.
  • From there navigate to Movies, Music or Videos; you should be able to see media files of the appropriate types (e.g. .jpg, .mp3).
You should now be able to transfer media files to or from the @usr$ folder directly using copy-and-paste in BBC BASIC. To transfer files of other types (e.g. .bbc) first rename the file to a media extension (e.g. .jpg) and then rename it back once it has reached its destination.
Hated Moron

Re: Accessing the @usr$ folder in Android

Post by Hated Moron »

Hated Moron wrote: Mon 08 Jan 2024, 18:29 You should now be able to transfer media files to or from the @usr$ folder directly using copy-and-paste in BBC BASIC. To transfer files of other types (e.g. .bbc) first rename the file to a media extension (e.g. .jpg) and then rename it back once it has reached its destination.
Experimentally it seems that transferring files from BBC BASIC to (say) the Android Documents folder does not require any renaming tricks, it works straightforwardly (Copy the source file and Paste it in Documents).

It's only when transferring to BBC BASIC from the Documents folder that renaming to a media file extension (e.g. .jpg) and then back again (e.g. to .bbc) when it has reached its destination is necessary.

As mobile devices (even running the same version of Android) don't always seems to behave consistently, if you do find that this isn't the case for your device please report it here.