I have an aplication that have to keep some information on the mobile i decided to use generate xml every time and save it on a file of my project.
How can i create a XML and save it on a file of my project onClickEvent?
I have an aplication that have to keep some information on the mobile i decided to use generate xml every time and save it on a file of my project.
How can i create a XML and save it on a file of my project onClickEvent?
Please, look a this documentation: Storage Options
It explains pretty clearly how to write into a file.
Then, I recommend you to use "JSON" instead of "XML" because it's easier to use. Add your datas in a JSONObject and write your JSONObject in the file using myJsonObject.toString()
.
For taking back, read your file content and parse it in a new JSONObject like that:
JSONObject jsonDatas = new JSONObject(fileContent);