Android Mode saving and loading txt file

sorry, i not understand why you say

Also don’t write the “loadStrings” or “loadImage” like this - “loadStrings(“data/Example.txt”)”.

as i would think it is actually the good way?

// processing 3.4   / Java Mode
// https://processing.org/reference/loadStrings_.html
// https://processing.org/reference/saveStrings_.html

// pls make a subdir /data/
// and have the file there as
// /data/HalloWorld.txt
// if the file is not found you get that red warning
//
// The file "HalloWorld.txt" is missing or inaccessible, make sure the URL is valid
// or that the file has been added to your sketch and is readable.

// String filename1="HalloWorld.txt";
// you see, no path info given here, so the /data/ dir is assumed as default and works 
// but

String filename1="data/HalloWorld.txt";

// is actually a good way to do it.


// for saving a file we read:
// By default, this file is saved to the sketch's folder.
// but we don't want that there!
// to be more compatible to the loadStrings command
// the example should be changed to also using the /data/ dir.

String filename2="data/HalloWorld_copy.txt";

// funny thing on win7: the copy file is 2 bytes longer.

String[] lines;

//______________________________________________________
void get_it () {
  println("read from: "+filename1);
  lines = loadStrings(filename1);
  println("there are " + lines.length + " lines in "+filename1);
  for (int i = 0; i < lines.length; i++) {
    println(lines[i]); // println((i+1)+"_ "+lines[i]);
  }
}

//______________________________________________________
void save_it() {
  println("save to: "+filename2);
  saveStrings(filename2, lines);
}
//______________________________________________________
void setup() {
  get_it();
  save_it();
}

but as i state in the code, i only play processing 3.4 Java mode…
and not “Processing for Android”