Currently I have an app that I am developing that uses the following code to test whether or not a file exists and if the file does not, it is created and stored in internal storage.
public void linkToFile()
{
if(checkFileExists() == true)
{
System.out.println("Contacts file exists, reading file");
}
else
if(checkFileExists() == false)
{
System.out.println("Contacts file does not exist, creating file");
try
{
FileOutputStream fileOutputStream = openFileOutput(cFile, Context.MODE_PRIVATE); //Creates contactFile.txt in internal storage
System.out.println(cFile + " file created.");
}
catch(java.io.FileNotFoundException e)
{
System.out.println("File not found exception");
e.printStackTrace();
}
}
}
This all works completely fine and as it should. However I have an issue in that I want to be able to view the contents of the file that is created at runtime. The app I am creating is a contacts app and therefore it would aid me greatly in being able to read the contents of the file whilst the application is running so that I can see what is being produced and stored in the file by the application, otherwise I'll be trying to develop this blind and it'll be much harder to do.
Is there a way in Android studio for me to be able to see which files are created by the app and stored in the internal storage at runtime? A file explorer or something for example? I'm not talking about being able to read the contents of the text file using java code, I'm talking about actually opening the created file like you would using Finder on Mac or Explorer on Windows, but in Android Studio if that is possible?