I am trying to create a simple text file in my android app using the code:
FileOutputStream fileout=mContext.openFileOutput("mytextfile.txt", mContext.MODE_PRIVATE);
OutputStreamWriter outputWriter=new OutputStreamWriter(fileout);
outputWriter.write(String.valueOf(executionTime));
outputWriter.close();
Log.d("write","Done writing to 'mysdfile.txt'");
and I log the different file paths as:
String absoluteFilePath=new File(".").getAbsolutePath();
String canonicalFilePath=new File(".").getCanonicalPath();
String filePath=new File(".").getPath();
Log.d("absolutepath",absoluteFilePath);
Log.d("canonicalpath",canonicalFilePath);
Log.d("path",filePath);
and in the debugger I see the file paths as:
When I click on the absolute path blue mark, it took me to the Macintosh HDD folder. The remaining two paths didn't make any sense to me.
I also checked my current directory and the file is not in there. I am trying to store the file in internal storage.
I am testing this on lollipop device.
Note: I see the file created in DDMS when the app is run on emulator, but not on device.
Where can I find the file that is created by FileOutputStream ?