Saving public files in the internal storage

前端 未结 2 1918
日久生厌
日久生厌 2021-02-19 07:17

I have an application that saves files downloaded from a server. These files are not private to my application and should be accessible to other applications as well. I want to

2条回答
  •  情歌与酒
    2021-02-19 07:44

    On some devices, the internal memory is represented by /emmc/.

    /emmc/ may exist on some devices, and it may be internal, but it may not be accessible to applications, and it certainly is not part of the Android SDK unless that happens to be what getExternalStorageDirectory() returns.

    But is it really representative of the internal memory?

    No.

    Or is it the third memory?

    Ask your device manufacturer.

    Should I save the files using openFileOutput() with MODE_WORLD_READABLE ?

    That is impossible to answer in the abstract. You say that your files "should be accessible to other applications as well", but you have not indicated why you expect any other application to care one bit about your files. Other applications will not be scanning your directories for files -- at best, they will allow users to browse external storage. The only reason to have a file that is MODE_WORLD_READABLE is if your application will be triggering another application to do something with the file (e.g., ACTION_VIEW Intent).

提交回复
热议问题