-3

I have created a file using

` try {
            File myFile = new File("myfile");
            if (myFile.exists())
                myFile.delete();
            outputStream = openFileOutput("myfile", Context.MODE_PRIVATE);
            Log.d("MyServiceActivity", "file written");
            outputStream.write(User.getInstance().getUserId().getBytes());
            outputStream.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
`

How do i view the file created manually. Thanks in advance

John
  • 13
  • 5

1 Answers1

0

Since the file is saved with Context.MODE_PRIVATE it is into internal memory, if you dont have root you will be not able to see this file with your phone

The best aproach to view your file is to open device monitor or Android monitor that is place in your Android Studio IDE

enter image description here

Note: run your app in debug mode to be able to see internal memory directories and files !

Be sure to have your device pluged to your pc to run it

Happy coding

Gastón Saillén
  • 12,319
  • 5
  • 67
  • 77