It’s been a while since i checked on this topic, and our own Nex provided a solution. I had a slight missunderstanding on how internal files work on Android, Nex thankfully corrected my stupidity 🙂
What are local files? On Android, your application has a private directory it can store files in. These are usually refered to as internal files. Since we use the “internal” name for the assets/ directory, we decided to call these type of files “local” instead. Other applications or the user do not have access to this directory (unless they are rooted, then all bets are off). The local files directory is usually stored on the internal storage as far as i understand, so you shouldn’t go crazy with storing GBs of data there.
Our new FileType#Local allows you to write to that directory. On the desktop it will resole to the working directory, usually the directory you started the jar from. On Android it resolves to the internal directory of the application.
FileHandle file = Gdx.files.local("myFile.txt");
boolean isLocalDirAvailable = Gdx.files.isLocalStorageAvailable();
String localDir = Gdx.files.getLocalStorageDirectory();
The local storage is always available, which is not true for external storage. You can create directories, list directories and so on and so forth, just as with external or absolute files. Local files are read/write.
Thanks for the addition Nex!