Android: Looking for clarity around File::globalApplicationsDirectory

When calling File::getSpecialLocations with globalApplicationsDirectory, JUCE returns /system/app/.

This doesn’t coincide with what I see here on my personal devices that are Android 12 and 13, where the global apps directory is /data/data/.

Does anybody have more details around this? It seems wrong but I can’t seem to find any official details about this (Android docs are the easiest and most clear to search through! Just amazing!).

It looks like "/​system/​app/"​ is where the pre-installed applications are installed. At the very least, that doesn’t jive with the doc’s statement for globalApplicationsDirectory: "The directory in which applications normally get installed.".

It seems like this information gets a bit more complicated to determine since Android app devs can specify different places to install applications as shown here: App install location  |  Android Developers .

Also, "/​data/​app/​" appears to be a common location (as per various blogs and SO posts).

What a confusing mess.

The “System App” directory is intended for Android OS distributors (phone mfr’s/etc.) to bundle included Apps on the internal “ROM” partition (in quotes because its just write-protected, usually, and often “isn’t”…) …

A good explanation - for Android - can be found here - but do note, other platforms have equivalents
it is similar to ‘c:\program files’ on Windows, ‘/usr’ on regular Linux, and … on MacOS … the closest ‘equivalent’ might be “/Applications” but in fact is more like “~/Library” as well… :

The reason its so confusing, is that anyone can put an app in “/system/apps”, its not so secure as one might think - the purpose of the path is more for reading, i.e. gaining access to known onboard apps, than anything else.

Best not to write there and instead use “File::getSpecialLocation (File::userApplicationDataDirectory).getFullPathName()”, if you need it …

Incidentally, all this PATH confusion can be better wrangled with SystemInfoDemo.h …