I have recently begun a project which involves me saving a string of results from my android application to the internal storage of my phone. This is the code that I have used to do this:
case R.id.saveButton:
String fileName = "testFile";
FileOutputStream outputStream;
try {
outputStream = openFileOutput(fileName, Context.MODE_PRIVATE);
outputStream.write(results.getBytes());
outputStream.close();
Toast.makeText(getApplicationContext(), "File Saved", Toast.LENGTH_LONG).show();
} catch (IOException e) {
Log.d("FILE", "Error when saving the file");
}
break;
the toast message is appearing correctly on the screen but I cannot seem to find the file on the phone. My question is where is the file saved on the phone and can I access it? If i cant access it is there a way to make the file visible on the phone so I can access it?