I have a file which I created and is present in data/data/com.andr.filedemo/files/a.xml.
Now I want to parse this file using XML Pull parser. How can we give the path of that file or how we can access that file and then parse that file using XML Pull parser.
Can anyone help me in sortig out this issue?
Thanks in Advance,
Asked
Active
Viewed 1,182 times
2

Android_programmer_camera
- 13,197
- 21
- 67
- 81
1 Answers
2
reading file from sdcard :http://stackoverflow.com/questions/3779944/reading-a-specific-file-from-sdcard-in-android
parsing xml file : You can use below packages import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; //import org.xmlpull.v1.XmlPullParserException.html; import org.xmlpull.v1.XmlPullParserFactory;

Maneesh
- 6,098
- 5
- 36
- 55
-
Thankyou. I want to how can we check in our application whether a particular file exists in data/data/com.stf.filedemo/files in this directory. – Android_programmer_camera Oct 27 '10 at 07:04
-
Here you can file exist File yourFile = new File(getDir(null, 0), "path/to/the/file/inside/the/sdcard.ext"); yourFile.exists(); – Maneesh Oct 27 '10 at 07:16