In our cross-platform world we have to deal with four distinct operating systems: iOS, macOS, Windows and Android (tvOS is really close to iOS, Android TV is basically Android). Each of these have different ways of handling files. They are broken down into different classifications of data:
App data – i.e. the App Bundle/APK/Directory with the Win32 .exe file. This is read only and on Android the .apk is a .zip file and not an actual directory. There are extra steps needed to access some files here. Should be in the docs for system.ResourceDirectory.
User data: For iOS and macOS Apple tries to describe the rules here: https://developer.apple.com/library/content/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html
Basically what we call system.DocumentsDirectory is the Documents directory from that doc. It’s backed up. All user data should go here. Content here, when tethered (physically or by WiFi) to iTunes can be accessed from iTunes. There may be a little bit of magic needed to turn it on.
system.ApplicationSupportDirectory is backed up and is used to store configuration items you don’t want exposed in Documents. It seems a game settings file would be appropriate here. On macOS this is the /User/yourname/Library/Application Support folder. We of course will make a folder for your project in there and map that to your system.ApplicationSupportDirectory. On Windows this ends up in /Users/yourname/AppData/Roaming/Appname I believe. I don’t know that Android has this concept so we may just make a folder for it in the sandbox. I’ll have to research that further.
Apple want’s files that can be downloaded from the Internet in a “Caches” folder. I believe this is part of the Library part of the system and not in the physical app bundle (based on reading the app doc.) For the other OS’s I’m not 100% sure were we physically put them and the same for the system.TemporaryDirectory where the system’s all handle tmp files a bit differently.
But at the end of the day:
system.ResourceDirectory: Read-Only, your app bundle/.apk
system.DocumentsDirectory: Store user created files here. Backed up to iCloud on Apple devices, potentially visible to iTunes.
system.CachesDirectory: If you can fetch it from the Internet, put it here, subject to periodic purging. You can always re-download it!
system.TemporaryDirectory: Put temp files here, purged frequently
system.ApplicationSupportDirectory: Like Documents directory will be backed up to iCloud on Apple devices. Hidden from iTunes. Configuration files are typically stored here.
Hope that clears it up.
Rob