How can I parse my local XML file located in my android project (inside res/XML folder) and want to get the values in that file.
Parse local XML file in Android
By : Tamaghna M
to read your xml add code as shown below
XmlResourceParser myxml = mContext.getResources().getXml(R.xml.MyXml); //MyXml.xml is name of our xml in newly created xml folder, mContext is the current context // Alternatively use: XmlResourceParser myxml = getContext().getResources().getXml(R.xml.MyXml); myxml.next();//Get next parse event int eventType = myxml.getEventType(); //Get current xml event i.e., START_DOCUMENT etc.
and to get content of code add code shown below
By : Khan
This video can help you solving your question :)