How to read data from an xml file in xml folder of resources, in Android application?
Use XMLResource parser to read the resource file, and parse it.
Use XMLPullParser to read the resource file, and parse it.
We can either use option 1 or option 2 to read xml resource files.
Use layoutinflater to inflate xml file and then read the data.
For pulling data from an XML file which is stored in xml folder or resources, then we have to use XMLResourceParser.
Eg: XmlResourceParser xp = getResources().getXml(R.xml.myfile);
Back To Top