I am using yahoo local search web service in my android application. I am getting xml reply from yahoo local search query. I want to know do i need to parse that xml file to read? and how can i read specific elements of all results. there are multiple elements of a single result. I want to read few elements of all results. any suggestion or code exmple would be really helpful. Thanks in advance.
DocumentBuilderFactory and SAXParserFactory are both part of the Java API supported by Android. Start with one of these. DocumentBuilder / DocumentBuilderFactory requires more memory but is a bit easier to work with. SAXParser / SAXParserFactory doesn't store the entire XML document in memory but you need to keep track of the current state yourself.
I'm currently working on an app that reads several xml files from a server. At first glance the DocumentBuilder approach looked easiest. But if you take some time to dive into the matter, you'll probably find the SAX approach more clear and in the end easier to use. At least I did. Also, at a certain point I needed to fetch data between open- and close tags and the DocumentBuilder approach can't do that .