Create xml file and save it in internal storage android

Viewed 33454

I want to check in the android internal storage if new.xml exists(which will be created by me) then it should return me a handle for it and i may be easily able to append new data to it.If it doesn't exists create a new one and add data to it.

My xml file structure will be simple like this.

<root>
    <record>a</record>
    <record>b</record>
    <record>c</record>
</root>

If the file is there I will only add a new record to it.But if doesn't than I will create a new file and add the first record to it.

And How I will be able to read this data in an arraylist. An example with code would be great thanks in advance.

3 Answers
Related