So I'm trying to figure out where my files are stored when using openFileOutput. Where does this file get saved to on my device?
String FILE_NAME = edit_fileName.getText().toString();
FileOutputStream outputStream;
try {
outputStream = openFileOutput(FILE_NAME, Context.MODE_PRIVATE);
} catch (Exception e) {
edit_fileName.setText(FILE_NAME + " could not be created/opened.");
}
edit_fileName.setText(getDir(FILE_NAME, Context.MODE_PRIVATE).toString());
getDir()
returns "/data/data/com.myname.myapp/app_[whatever FILE_NAME is]
. But when I look at my device files on my computer, I can't seem to find anything like that anywhere. No documentation I've seen has helped me.
EDIT: Updated Code:
FileOutputStream outputStream;
File newFile;
newFile = new File(Environment.getExternalStorageDirectory() + FILE_NAME);
try {
outputStream = new FileOutputStream(newFile);
outputStream.write("test".getBytes());
} catch (Exception e) {
edit_fileName.setText("Was unable to open " + FILE_NAME);
}
This code gives me this error:
java.lang.SecurityException: Permission Denial: get/set setting for user asks to run as user -2 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL