I want to include a file (which contains key-value-pairs) in an android app. I need to have write-access to the file, so I can not put it in raw
or assets
.
How can I do this? In standard java, I would just have put it in the project root.
I want to include a file (which contains key-value-pairs) in an android app. I need to have write-access to the file, so I can not put it in raw
or assets
.
How can I do this? In standard java, I would just have put it in the project root.
You would want to read and write to the internal storage of the device. getFilesDir()
gives you the file object for your app's private internal storage. And as per the note in the documentation here, if you use MODE_PRIVATE
with openFileInput
or openFileOutput
, the file will be private to your app only.