VOGONS


First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

Android has an option to move files of an application to the external SD or sdcard0(internal memory). Is there a way for SDL2 software(like UniPCemu I'm working on getting it working) to detect which of the two media the user has selected? So, when the user moves the files to/from external/internal SD, the application can use the selected paths? I currently have an in-application option that moves the settings file between the two locations(folder in the root of the sdcard/internal storage), and determines which of the two to use by looking at the folders and selecting the path of the file that exists(internal SD has higher priority).

The app moves the settings file around to switch storage media, but it can't detect the correct media to use yet. Also, any related files aren't moved, as those might be big(and unknown). Is there a way to get this information from SDL? (The internal/external storage paths give the folders on the two media, not the folder the user selected by moving data to/from MicroSD(Option in the Android application menu)?)

Where does sdl_AndroidGetExternalStoragePath() point to? Does it point to internal phone memory(in my case some 2GB internal memory, visible as /storage/sdcard0), or does it point to the SD card inserted in my phone(visible as /storage/external_SD)? How does myapplication know which one the user wants(according to the Android settings for it's data directory, which is either /storage/sdcard0/Android/data/com.unipcemu.app or /storage/external_SD/Android/data/com.unipcenu.app), depending on the current setting(defaults to sdcard0 during installation, can be moved from the UniPCemu setting at Android Settings > Applications > All apps > UniPCemu > Move data to MicroSD/Internal Storage button.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 1 of 1, by BloodyCactus

User metadata
Rank Oldbie
Rank
Oldbie

I believe it just points to the external storage, not internal. If you dont have any, it redirect internally, ie: the /storage/emulated/0 symlink for your app path gets adjusted.

I believe, if you trigger the move, android symlinks to it, so you dont kneed to actually know the physical path.

I wonder of SDL2 just calls the Environment.getExternalStorageDirectory().getAbsolutePath() api...

--/\-[ Stu : Bloody Cactus :: [ https://bloodycactus.com :: http://kråketær.com ]-/\--