/**
* Get version information and app ID from config.
*
* @param URLPath
* @return
* @throws Exception
*/
Public list<string> Getupdateinfo () {
Resources r = context.getresources ();
Access to Xmlresourceparser instances through resources
Xmlresourceparser XRP = R.getxml (r.xml.config);
list<string> list = new arraylist<string> ();
If the start tag
try {
If you do not continue to the end of the file
while (Xrp.geteventtype ()! = xmlresourceparser.end_document) {
If the start tag
if (xrp.geteventtype () = = Xmlresourceparser.start_tag) {
Get label name
String name = Xrp.getname ();
Determine if the label name equals friend
if (Name.equals ("Update")) {
Get tag attributes appended to StringBuilder
List.add (xrp.getattributevalue (0));
List.add (Xrp.getattributevalue (1));
List.add (Xrp.getattributevalue (2));
}
} else if (xrp.geteventtype () = = Xmlpullparser.end_tag) {
} else if (xrp.geteventtype () = = Xmlpullparser.text) {
}
Next label
Xrp.next ();
}
} catch (Xmlpullparserexception e) {
E.printstacktrace ();
} catch (IOException e) {
E.printstacktrace ();
}
return list;
}
Android Read XML