开发者

How to update an XML file while the Android app is running in a device or emulator?

Can anyone tell me a way to store an XML file in the android apps so that I can update it in a regular basis just like we do it in SQlite database. I am developing an apps in which I use an xml file to store data and I need to update the data on regular basis, please tell me a way to store the xml file. Means where should I stor开发者_C百科e that xml file so that I can update it.


Means where shud I store that xml file so that I can update it.

Usually, you will want to save it in the private directory for your app. You can get a pointer to that directory by invoking the getFilesDir method from an Activity or other kind of contexts. Other useful method is openFileOutput which returns a FileOutputStream that you can use to save a file. This should answer your question how "where to save" the file.


The documentation on Data Storage is good, this should give you an idea of which method best suits your needs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜