Writing to the internal private storage in Android

后端 未结 6 2265
粉色の甜心
粉色の甜心 2020-12-06 01:44

I am trying to save some data from my app in a simple text file on the internal private storage area (app user preferences). I have read through many questions on here (Stac

6条回答
  •  -上瘾入骨i
    2020-12-06 02:19

    I was dealing with the same issue. Finally, I found that you really don't have to give all file paths in order to create a new file in internal storage. Just mention the file name and it will be created under your app's package folder at the device. I did exactly mentioned here

    And it works perfectly. I would say avoid mentioning Full file path like : /data/... in order to create a file (you need write permissions to create a file in such a manner). Let Android framework do the job for creating a private file for your app.

提交回复
热议问题