I’ve been searching for a simple example(s) each for read/ write/ edit XML for android. The file can be saved in res/raw folder or assets/ other folder of the application file structure. But NO tutorial is proper with easy code samples.
Some tutorials talk about different XML parsers like- SAX, DOM etc but it will be better to have all 3 examples using a particular API/ parser. Unlike SAX which is ONLY to read xml.
http://www.mkyong.com/java/how-to-modify-xml-file-in-java-dom-parser/
This is a good DOM tutorial but it’s not for android. I have problem deciding where to store the xml file !! Creating InputStream & StreamResult or other objects for android.
So please point out some simple examples for 1) read 2) write 3) edit using a SINGLE api/ parser/ framework- say DOM or other. Which also includes where & how to store that file 1) internal storage 2) external (SD)
Hope this also helps other newbies.
Well I would love to help you on the writing XML portion of your problem if you could still use assistance. Yet I need help myself on the subject of editing the XML. I have an idea of how to edit the XML if I was to use string parsing, but I have no clue of how to go about updating the original XML file… [Sorry if I lost you there.] But I am going to edit a code that has suited me so you can take a peek. 🙂
-Kai (A NEWB As Well)
Reading From XML In Android 🙂
The Demo XML
Reading The XML
I hope this helps :/