Where are files created using FileOutputStream on Android?

后端 未结 3 1595
太阳男子
太阳男子 2021-01-23 04:27

I\'ve created a file in my code, as shown below

 FileOutputStream fOut = openFileOutput(\"samplefile.txt\", MODE_WORLD_READABLE);
 OutputStreamWriter osw = new O         


        
相关标签:
3条回答
  • 2021-01-23 05:04

    You can get the address of it be below line Code

     File file = getFileStreamPath("samplefile.txt");
    

    And for print it

    String s  = file.getAbsolutePath();
    
    0 讨论(0)
  • 2021-01-23 05:12

    If you googled you could find this site link

    which mentions

    Android allows to persists application data via the file system. For each application the Android system creates a data/data/[application package] directory.

    0 讨论(0)
  • 2021-01-23 05:16

    The file is being saved to internal storage (see this link).

    You can retrieve the path of the file with getFilesDir() (see this link).

    The path is /data/data/yourapplicationpackagename/files.

    0 讨论(0)
提交回复
热议问题