I found that you can use something like this to create a file:
FileOutputStream fs = openFileOutput("/test.in", MODE_WORLD_WRITEABLE);
String s = "[Head]\r\n";
s += "Type=2";
byte[] buffer = s.getBytes();
fs.write(buffer);
fs.close();
When I run the above code, I get an IllegalArgumentException:
java.lang.IllegalArgumentException: file /test.in contains the path separator
and I assume that "/" is not appreciated. I wanted "/", since I need to write the file to the root directory of the device, as indicated in the API when trying to follow:
The request is a text file (UNICODE) with the file extension ".in". The application reads and analyzes the .in file when it is in the root directory of the mobile device.
Question: how do I put a file in the root directory? I was looking for an answer, but have not yet found.