I am downloading an xml file from ftp and using the following code to store :
FileOutputStream stream = openFileOutput("emp.xml", MODE_WORLD_WRITEABLE);
cd = ftp.retrieveFile("emp.xml", stream);
I want to read this file to parse in my application later.Previously i was using this code as i ahd stored it in res/xml folder :
XmlResourceParser parser = this.getResources().getXml(R.xml.employees);
How should i replace the above code to get emp.xml file.
Thanks in advance!
Use
XmlPullParser. You can use aFileReaderor aFileInputStreamas the input for the parser.You can take a look at the tutorial “Parsing XML Data with XmlPullParser”.