I have followed the Android instructions to save a file in the storage space of my App .
String filename = "myfile";
String string = "Hello world!";
FileOutputStream outputStream;
try {
outputStream = openFileOutput(filename, Context.MODE_PRIVATE);
outputStream.write(string.getBytes());
outputStream.close();
Log.i(TAG, "writeToFile OK" );
} catch (Exception e) {
e.printStackTrace();
}
Then I try to see if my file is inside a folder with the app Explorador
, but I can not find it anywhere.
In the Log you can see that indeed the code enters the try
since it prints writeToFile OK
and there are no errors.
Why can not I find the file?
NOTE: I tried with and without the permissions indicated by Android:
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
In the documentation it is also not clear if that permission is only for writing in external storage. By the name it seems that yes. Anyway I tried with that permission and without it, and I can not find the file in any way.