(android) read and load a txt file

To save/load from internal storage it works with those changes:
file_path = lime.system.System.applicationStorageDirectory + “hello.txt”;
var path = new haxe.io.Path(file_path);
File.saveContent(haxe.io.Path.join([path.dir, path.file]),textInput.text);

External storage is more tricky because it depends on many things, android version, multi user environment,…
https://developer.android.com/reference/android/content/Context#getExternalFilesDir(java.lang.String)

1 Like