im writing a visualiser and need save and load settings here is a quick save file function.
still working on the string save function and open function.
got this from stackoverflow works to save file to Android internal storage SDCARD.
import android.os.Environment; // need this for Environment Android stuff
public void SaveFile() {
try { String filename="visualiser.txt"; String directory = new String(Environment.getExternalStorageDirectory().getAbsolutePath() ); save(directory + "/" + filename); } catch (Exception e) {
} }
just call SaveFile(); or what ever you want to call it... you will need to set sketch permissions to WRITE_EXTERNAL_STORAGE for file io.
anyone know of a simple method to read write load file into a string.
seen a few methods but it seems overly complicated. createbuffer writebuffer etc.
im no expert in android or java so dont ask me how this works. but its sort of easy to follow. ( declare name/find path/savefile/catch error etc).