Saving and loading files

edited July 2014 in Android Mode

Hi I am working on a bluetooth remote app that saves controller layouts as .txt files. Saving and then loading the files already works. But only in this order. If I try to load a save file that does not exist, the app crashes. This is understandable. But the real problem is:

  • The file.exists()-function returns false at all times, even if the file exists.

    File f = new File("settings.txt"); if(!f.getAbsoluteFile().exists()) println("file not found"); else println("found");

  • Putting the file in the sketch data folder before compiling works but leads to the file being not rewriteable. This means the app somehow can't change the strings in the txt.

  • Writing a setup function to save the files at the first startup won't work, too, because the sketch is unable to check if it was executed before.

This makes it impossible to save any kind of progress whatsoever. Thanks in advance for your help!

Answers

Sign In or Register to comment.