What path does “getApplicationContext().getFilesDir()” return?

后端 未结 5 1695
余生分开走
余生分开走 2020-12-17 23:07

I\'m doing a simple app in Android and in a certain part of the app I would like to create an Excel file and write in it. I\'ve already prepared everything to use jexcel lib

5条回答
  •  死守一世寂寞
    2020-12-17 23:31

    If you want to access your file via your PC (with an usb cable) or via a file manager on your device, prefer:

    new File(getExternalFilesDir(null), fileName);
    

    This folder is created in .../Android/data/ ... com.yoursociety.yourapp/files ...

    null means that you do not want to store files in predefined folders like Movies, Pictures and so on.

    (See documentation for more info)

提交回复
热议问题