Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reading and Writing XML file

I have an Application in which first I want to create a backup of message from inbox and store it into backup.xml file which is stored at SDCARD/MYBACKUP/mybackup.xml

Now I want to retrieve data, stored on SDCARD/MYBACKUP/mybackup.xml and display all messages in listview.

like image 851
pratik Avatar asked Feb 13 '12 06:02

pratik


People also ask

How do you read and write an XML document?

We must have followed the process to read an XML file in Java: Instantiate XML file: DOM parser loads the XML file into memory and consider every tag as an element. Get root node: Document class provides the getDocumentElement() method to get the root node and the element of the XML file.

How do I read XML files?

XML files can be opened in a browser like IE or Chrome, with any text editor like Notepad or MS-Word. Even Excel can be used to open XML files. We also have Online editors to open XML files.

What is XML reader and writer?

The XmlReader, XmlWriter and their derived classes contains methods and properties to read and write XML documents. With the help of the XmlDocument and XmlDataDocument classes, you can read entire document. The Load and Save method of XmlDocument loads a reader or a file and saves document respectively.


1 Answers

For Writing XML file to sdcard see this answeer Qberticus's Answer

android Reading file is just simple you have to use Xml parsing See This for XML parsing

To R/W Sdcard You have to give Permission

   <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
like image 188
Tofeeq Ahmad Avatar answered Sep 18 '22 16:09

Tofeeq Ahmad