{"id":316,"date":"2010-10-26T20:26:00","date_gmt":"2010-10-26T20:26:00","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/2012\/10\/android-full-app-part-3-parsing-the-xml-response.html"},"modified":"2012-10-21T19:20:17","modified_gmt":"2012-10-21T19:20:17","slug":"android-full-app-part-3-parsing-xml","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-3-parsing-xml.html","title":{"rendered":"Android Full App, Part 3: Parsing the XML response"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align: left\">This is the third part of the <a href=\"http:\/\/www.javacodegeeks.com\/2010\/10\/android-full-application-tutorial.html\">\u201cAndroid Full Application Tutorial\u201d series<\/a>. The complete application aims to provide an easy way of performing movies\/actors searching over the internet. In the first part of the series (<a href=\"http:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-1-main-activity.html\">\u201cMain Activity UI\u201d<\/a>), we created the Eclipse project and set up a basic interface for the main activity of the application. In the second part (<a href=\"http:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-2-using-http-api.html\">\u201cUsing the HTTP API\u201d<\/a>), we used the Apache HTTP client library in order to consume an external HTTP API and  integrate the API&#8217;s searching capabilities into our application. In this part we are going to see how to parse the XML response using Android&#8217;s built-in XML parsing capabilities.<\/p>\n<p>The <a href=\"http:\/\/api.themoviedb.org\/2.1\">TMDb API<\/a> supports both XML and JSON formats for the HTTP responses. We are going to use XML for our application. Let&#8217;s see first how some sample responses to search queries look like:<\/p>\n<ul>\n<li><a href=\"http:\/\/dl.dropbox.com\/u\/7215751\/JavaCodeGeeks\/AndroidFullAppTutorialPart03\/Transformers+2007.xml\">Movies search for \u201cTransformers\u201d and (year) \u201c2007\u201d<\/a><\/li>\n<li><a href=\"http:\/\/dl.dropbox.com\/u\/7215751\/JavaCodeGeeks\/AndroidFullAppTutorialPart03\/Brad+Pitt.xml\">Person search for \u201cBrad Pitt\u201d<\/a><\/li>\n<\/ul>\n<p>The responses are typical XML documents that can be parsed using the standard procedures either using <a href=\"http:\/\/en.wikipedia.org\/wiki\/Simple_API_for_XML\">SAX<\/a> or <a href=\"http:\/\/en.wikipedia.org\/wiki\/Document_Object_Model\">DOM<\/a>. The SAX specification defines an event-based approach where the implemented parsers scan through XML data and they use call-back handlers whenever certain parts of the document have been reached. On the other hand, the DOM specification defines a tree-based approach to navigating an XML document. <\/p>\n<p>In general, SAX&#8217;s usage is more challenging, because the API requires development of callback functions that handle the events, while the DOM approach requires a bigger memory footprint. For that reason, we are going to choose SAX for our XML parsers implementation, since our application will leave in a rather resource-constrained environment such as a mobile device.<\/p>\n<p>Before we proceed with the XML parsing, we are going to create some model classes which will map the XML elements to Java classes. By simply looking at the XML responses, the following model classes can be derived:<\/p>\n<pre class=\"brush:java\">package com.javacodegeeks.android.apps.moviesearchapp.model;\r\n\r\nimport java.util.ArrayList;\r\n\r\npublic class Person {\r\n    \r\n    public String score;\r\n    public String popularity;\r\n    public String name;\r\n    public String id;\r\n    public String biography;\r\n    public String url;\r\n    public String version;\r\n    public String lastModifiedAt;\r\n    public ArrayList&lt;Image&gt; imagesList;\r\n\r\n}\r\n<\/pre>\n<pre class=\"brush:java\">package com.javacodegeeks.android.apps.moviesearchapp.model;\r\n\r\nimport java.util.ArrayList;\r\n\r\npublic class Movie {\r\n    \r\n    public String score;\r\n    public String popularity;\r\n    public boolean translated;\r\n    public boolean adult;\r\n    public String language;\r\n    public String originalName;\r\n    public String name;\r\n    public String type;\r\n    public String id;\r\n    public String imdbId;\r\n    public String url;\r\n    public String votes;\r\n    public String rating;\r\n    public String certification;\r\n    public String overview;\r\n    public String released;\r\n    public String version;\r\n    public String lastModifiedAt;\r\n    public ArrayList&lt;Image&gt; imagesList;\r\n    \r\n    public String retrieveThumbnail() {\r\n        if (imagesList!=null &amp;&amp; !imagesList.isEmpty()) {\r\n            for (Image movieImage : imagesList) {\r\n                if (movieImage.size.equalsIgnoreCase(Image.SIZE_THUMB) &amp;&amp;\r\n                        movieImage.type.equalsIgnoreCase(Image.TYPE_POSTER)) {\r\n                    return movieImage.url;\r\n                }\r\n            }\r\n        }\r\n        return null;\r\n    }    \r\n\r\n}\r\n<\/pre>\n<pre class=\"brush:java\">package com.javacodegeeks.android.apps.moviesearchapp.model;\r\n\r\npublic class Image {\r\n    \r\n    public static final String SIZE_ORIGINAL = \"original\";\r\n    public static final String SIZE_MID = \"mid\";\r\n    public static final String SIZE_COVER = \"cover\";\r\n    public static final String SIZE_THUMB = \"thumb\";\r\n\r\n    public static final String TYPE_PROFILE = \"profile\";\r\n    public static final String TYPE_POSTER = \"poster\";\r\n    \r\n    public String type;\r\n    public String url;\r\n    public String size;\r\n    public int width;\r\n    public int height;\r\n    \r\n}\r\n\r\n<\/pre>\n<p>Nothing really special here, we are just adding String fields for each XML element. Note that the Image class will be commonly used by both the Person and Movie class. Also, the Movie class provides the retrieveThumbnail method which loops through the available Images and returns the one of size \u201cthumb\u201d and type \u201cposter\u201d.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>We proceed with creating a class named XmlParser which uses SAX approach in order to parse the XML responses. The class uses two custom handlers (PersonHandler and MovieHandler) in order to  perform the parsing. The code for that class is the following:<\/p>\n<pre class=\"brush:java\">package com.javacodegeeks.android.apps.moviesearchapp.services;\r\n\r\nimport java.io.StringReader;\r\nimport java.util.ArrayList;\r\n\r\nimport javax.xml.parsers.ParserConfigurationException;\r\nimport javax.xml.parsers.SAXParser;\r\nimport javax.xml.parsers.SAXParserFactory;\r\n\r\nimport org.xml.sax.InputSource;\r\nimport org.xml.sax.SAXException;\r\nimport org.xml.sax.XMLReader;\r\n\r\nimport com.javacodegeeks.android.apps.moviesearchapp.handlers.MovieHandler;\r\nimport com.javacodegeeks.android.apps.moviesearchapp.handlers.PersonHandler;\r\nimport com.javacodegeeks.android.apps.moviesearchapp.model.Movie;\r\nimport com.javacodegeeks.android.apps.moviesearchapp.model.Person;\r\n\r\npublic class XmlParser {\r\n    \r\n    private XMLReader initializeReader() throws ParserConfigurationException, SAXException {\r\n        SAXParserFactory factory = SAXParserFactory.newInstance();\r\n        \/\/ create a parser\r\n        SAXParser parser = factory.newSAXParser();\r\n        \/\/ create the reader (scanner)\r\n        XMLReader xmlreader = parser.getXMLReader();\r\n        return xmlreader;\r\n    }\r\n    \r\n    public ArrayList&lt;Person&gt; parsePeopleResponse(String xml) {\r\n        \r\n        try {\r\n            \r\n            XMLReader xmlreader = initializeReader();\r\n            \r\n            PersonHandler personHandler = new PersonHandler();\r\n\r\n            \/\/ assign our handler\r\n            xmlreader.setContentHandler(personHandler);\r\n            \/\/ perform the synchronous parse\r\n            xmlreader.parse(new InputSource(new StringReader(xml)));\r\n            \r\n            return personHandler.retrievePersonList();\r\n            \r\n        } \r\n        catch (Exception e) {\r\n            e.printStackTrace();\r\n            return null;\r\n        }\r\n        \r\n    }\r\n    \r\n    public ArrayList&lt;Movie&gt; parseMoviesResponse(String xml) {\r\n        \r\n        try {\r\n            \r\n            XMLReader xmlreader = initializeReader();\r\n            \r\n            MovieHandler movieHandler = new MovieHandler();\r\n\r\n            \/\/ assign our handler\r\n            xmlreader.setContentHandler(movieHandler);\r\n            \/\/ perform the synchronous parse\r\n            xmlreader.parse(new InputSource(new StringReader(xml)));\r\n            \r\n            return movieHandler.retrieveMoviesList();            \r\n            \r\n        } \r\n        catch (Exception e) {\r\n            e.printStackTrace();\r\n            return null;\r\n        }\r\n\r\n    }\r\n\r\n}\r\n<\/pre>\n<p>In each method, we first retrieve a reference of the SAX parser factory class using the <a href=\"http:\/\/developer.android.com\/reference\/javax\/xml\/parsers\/SAXParserFactory.html#newInstance%28%29\">newInstance<\/a> static method of the <a href=\"http:\/\/developer.android.com\/reference\/javax\/xml\/parsers\/SAXParserFactory.html\">SAXParserFactory<\/a>. That method returns the appropriate Android&#8217; implementation. Then, a <a href=\"http:\/\/developer.android.com\/reference\/javax\/xml\/parsers\/SAXParser.html\">SAXParser<\/a> object is created using the <a href=\"http:\/\/developer.android.com\/reference\/javax\/xml\/parsers\/SAXParserFactory.html#newSAXParser%28%29\">newSAXParser<\/a> method, which creates a new instance of a SAXParser using the currently configured factory parameters. The  SAXParser class defines the API that wraps an <a href=\"http:\/\/developer.android.com\/reference\/org\/xml\/sax\/XMLReader.html\">XMLReader<\/a> implementation class. <a href=\"http:\/\/developer.android.com\/reference\/org\/xml\/sax\/XMLReader.html\">XMLReader<\/a> is an interface for reading an XML document using callbacks. The callbacks are defined usually via classes that extend the <a href=\"http:\/\/developer.android.com\/reference\/org\/xml\/sax\/helpers\/DefaultHandler.html\">DefaultHandler<\/a> class, which is the default base class for SAX2 event handlers. We provide two handlers, one for parsing the person search responses (PersonHandler) and one for parsing the movies search responses (MovieHandler). The code for the PersonHandler class follows (the MovieHandler class is pretty same, thus is omitted for brevity &#8211; the source code for that class can be found in the available Eclipse project at the end of the tutorial):<\/p>\n<pre class=\"brush:java\">package com.javacodegeeks.android.apps.moviesearchapp.handlers;\r\n\r\nimport java.util.ArrayList;\r\n\r\nimport org.xml.sax.Attributes;\r\nimport org.xml.sax.SAXException;\r\nimport org.xml.sax.helpers.DefaultHandler;\r\n\r\nimport com.javacodegeeks.android.apps.moviesearchapp.model.Image;\r\nimport com.javacodegeeks.android.apps.moviesearchapp.model.Person;\r\n\r\npublic class PersonHandler extends DefaultHandler {\r\n    \r\n    private StringBuffer buffer = new StringBuffer();\r\n    \r\n    private ArrayList&lt;Person&gt; personList;\r\n    private Person person;\r\n    private ArrayList&lt;Image&gt; personImagesList;\r\n    private Image personImage;\r\n    \r\n    @Override\r\n    public void startElement(String namespaceURI, String localName,\r\n            String qName, Attributes atts) throws SAXException {\r\n        \r\n        buffer.setLength(0);\r\n        \r\n        if (localName.equals(\"people\")) {\r\n            personList = new ArrayList&lt;Person&gt;();\r\n        }\r\n        else if (localName.equals(\"person\")) {\r\n            person = new Person();\r\n        }\r\n        else if (localName.equals(\"images\")) {\r\n            personImagesList = new ArrayList&lt;Image&gt;();\r\n        }\r\n        else if (localName.equals(\"image\")) {\r\n            personImage = new Image();\r\n            personImage.type = atts.getValue(\"type\");\r\n            personImage.url = atts.getValue(\"url\");\r\n            personImage.size = atts.getValue(\"size\");\r\n            personImage.width = Integer.parseInt(atts.getValue(\"width\"));\r\n            personImage.height = Integer.parseInt(atts.getValue(\"height\"));\r\n        }\r\n\r\n    }\r\n    \r\n    @Override\r\n    public void endElement(String uri, String localName, String qName)throws SAXException {\r\n        \r\n        if (localName.equals(\"person\")) {\r\n            personList.add(person);\r\n        }\r\n        else if (localName.equals(\"score\")) {\r\n            person.score = buffer.toString();\r\n        }\r\n        else if (localName.equals(\"popularity\")) {\r\n            person.popularity = buffer.toString();\r\n        }\r\n        else if (localName.equals(\"name\")) {\r\n            person.name = buffer.toString();\r\n        }\r\n        else if (localName.equals(\"id\")) {\r\n            person.id = buffer.toString();\r\n        }\r\n        else if (localName.equals(\"biography\")) {\r\n            person.biography = buffer.toString();\r\n        }\r\n        else if (localName.equals(\"url\")) {\r\n            person.url = buffer.toString();\r\n        }\r\n        else if (localName.equals(\"version\")) {\r\n            person.version = buffer.toString();\r\n        }\r\n        else if (localName.equals(\"last_modified_at\")) {\r\n            person.lastModifiedAt = buffer.toString();\r\n        }    \r\n        else if (localName.equals(\"image\")) {\r\n            personImagesList.add(personImage);\r\n        }    \r\n        else if (localName.equals(\"images\")) {\r\n            person.imagesList = personImagesList;\r\n        }\r\n        \r\n    }\r\n    \r\n    @Override\r\n    public void characters(char[] ch, int start, int length) {\r\n        buffer.append(ch, start, length);\r\n    }\r\n        \r\n    public ArrayList&lt;Person&gt; retrievePersonList() {\r\n        return personList;\r\n    }\r\n    \r\n}\r\n<\/pre>\n<p>The standard approach for SAX parsing (described in many <a href=\"http:\/\/www.javaworld.com\/javaworld\/jw-05-2002\/jw-0517-sax.html\">tutorials online<\/a>) is used, thus the above code should look familiar if you have parsed XML documents before. Note though that instead of the qName parameter,  it is the localName variable that holds the element&#8217;s data.<\/p>\n<p>In our class, we define the necessary callback functions:<\/p>\n<ul>\n<li><a href=\"http:\/\/developer.android.com\/reference\/org\/xml\/sax\/helpers\/DefaultHandler.html#startElement%28java.lang.String,%20java.lang.String,%20java.lang.String,%20org.xml.sax.Attributes%29\">startElement<\/a>: Called when a new element is found. We initialize the appropriate field there.<\/li>\n<li><a href=\"http:\/\/developer.android.com\/reference\/org\/xml\/sax\/helpers\/DefaultHandler.html#endElement%28java.lang.String,%20java.lang.String,%20java.lang.String%29\">endElement<\/a>: Called when the element&#8217;s end has been reached. The corresponding field gets populated there.<\/li>\n<li><a href=\"http:\/\/developer.android.com\/reference\/org\/xml\/sax\/helpers\/DefaultHandler.html#characters%28char[],%20int,%20int%29\">characters<\/a>: Called when new text has been found inside an element. An internal buffer gets populated with the content of the element.<\/li>\n<\/ul>\n<p>Note that within a response, a number of Person elements might be found and inside each one of them, a number of Images can be found. Particularly for the images, the relevant information resides within the elements attributes and not inside a text node. Thus the appropriate <a href=\"http:\/\/developer.android.com\/reference\/org\/xml\/sax\/Attributes.html#getValue%28java.lang.String%29\">getValue<\/a> method is used in order to extract that information.<\/p>\n<p>At this point, the third part of the series has reached its end. In this part, we prepared the infrastructure for performing the XML parsing of the API responses using the SAX approach. At the following tutorials, we will use that in order to map the responses to our model classes. You can download <a href=\"http:\/\/dl.dropbox.com\/u\/7215751\/JavaCodeGeeks\/AndroidFullAppTutorialPart03\/AndroidMovieSearchAppProject_Part03.zip\">here<\/a> the Eclipse project created so far.<\/p>\n<div style=\"margin-bottom: 0px;margin-left: 0px;margin-right: 0px;margin-top: 0px\"><strong><i>Related Articles :<\/i><\/strong><\/div>\n<ul>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2010\/10\/android-full-application-tutorial.html\">\u201cAndroid Full Application Tutorial\u201d series<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2010\/09\/android-text-to-speech-application.html\">Android Text-To-Speech Application<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2010\/09\/android-reverse-geocoding-yahoo-api.html\">Android Reverse Geocoding with Yahoo API &#8211; PlaceFinder<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2010\/09\/android-location-based-services.html\">Android Location Based Services Application \u2013 GPS location<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2010\/06\/embracing-android-awesomeness-quick.html\">Install Android OS on your PC with VirtualBox<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2010\/06\/embracing-android-awesomeness-quick.html\">Embracing the Android awesomeness: A quick overview<\/a><\/li>\n<\/ul>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This is the third part of the \u201cAndroid Full Application Tutorial\u201d series. The complete application aims to provide an easy way of performing movies\/actors searching over the internet. In the first part of the series (\u201cMain Activity UI\u201d), we created the Eclipse project and set up a basic interface for the main activity of the &hellip;<\/p>\n","protected":false},"author":3,"featured_media":46,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[83,29],"class_list":["post-316","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android-core","tag-android-tutorial","tag-eclipse"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Android Full App, Part 3: Parsing the XML response - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"This is the third part of the \u201cAndroid Full Application Tutorial\u201d series. The complete application aims to provide an easy way of performing movies\/actors\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-3-parsing-xml.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android Full App, Part 3: Parsing the XML response - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"This is the third part of the \u201cAndroid Full Application Tutorial\u201d series. The complete application aims to provide an easy way of performing movies\/actors\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-3-parsing-xml.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2010-10-26T20:26:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2012-10-21T19:20:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/android-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ilias Tsagklis\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ilias Tsagklis\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/10\\\/android-full-app-part-3-parsing-xml.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/10\\\/android-full-app-part-3-parsing-xml.html\"},\"author\":{\"name\":\"Ilias Tsagklis\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/9a83496b285d30c61e8a674625c1350e\"},\"headline\":\"Android Full App, Part 3: Parsing the XML response\",\"datePublished\":\"2010-10-26T20:26:00+00:00\",\"dateModified\":\"2012-10-21T19:20:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/10\\\/android-full-app-part-3-parsing-xml.html\"},\"wordCount\":844,\"commentCount\":8,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/10\\\/android-full-app-part-3-parsing-xml.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/android-logo.jpg\",\"keywords\":[\"Android Tutorial\",\"Eclipse\"],\"articleSection\":[\"Android Core\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/10\\\/android-full-app-part-3-parsing-xml.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/10\\\/android-full-app-part-3-parsing-xml.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/10\\\/android-full-app-part-3-parsing-xml.html\",\"name\":\"Android Full App, Part 3: Parsing the XML response - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/10\\\/android-full-app-part-3-parsing-xml.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/10\\\/android-full-app-part-3-parsing-xml.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/android-logo.jpg\",\"datePublished\":\"2010-10-26T20:26:00+00:00\",\"dateModified\":\"2012-10-21T19:20:17+00:00\",\"description\":\"This is the third part of the \u201cAndroid Full Application Tutorial\u201d series. The complete application aims to provide an easy way of performing movies\\\/actors\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/10\\\/android-full-app-part-3-parsing-xml.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/10\\\/android-full-app-part-3-parsing-xml.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/10\\\/android-full-app-part-3-parsing-xml.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/android-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/android-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/10\\\/android-full-app-part-3-parsing-xml.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Android\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/android\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Android Core\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/android\\\/android-core\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Android Full App, Part 3: Parsing the XML response\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/9a83496b285d30c61e8a674625c1350e\",\"name\":\"Ilias Tsagklis\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/43505f28bb49f6e290c24be0b209ccc1af350f0f6587025ffd4847ef44bf6b78?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/43505f28bb49f6e290c24be0b209ccc1af350f0f6587025ffd4847ef44bf6b78?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/43505f28bb49f6e290c24be0b209ccc1af350f0f6587025ffd4847ef44bf6b78?s=96&d=mm&r=g\",\"caption\":\"Ilias Tsagklis\"},\"description\":\"Ilias is a software developer turned online entrepreneur. He is co-founder and Executive Editor at Java Code Geeks.\",\"sameAs\":[\"http:\\\/\\\/www.iliastsagklis.com\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/iliastsagklis\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/ilias-tsagklis\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Android Full App, Part 3: Parsing the XML response - Java Code Geeks","description":"This is the third part of the \u201cAndroid Full Application Tutorial\u201d series. The complete application aims to provide an easy way of performing movies\/actors","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-3-parsing-xml.html","og_locale":"en_US","og_type":"article","og_title":"Android Full App, Part 3: Parsing the XML response - Java Code Geeks","og_description":"This is the third part of the \u201cAndroid Full Application Tutorial\u201d series. The complete application aims to provide an easy way of performing movies\/actors","og_url":"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-3-parsing-xml.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2010-10-26T20:26:00+00:00","article_modified_time":"2012-10-21T19:20:17+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/android-logo.jpg","type":"image\/jpeg"}],"author":"Ilias Tsagklis","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Ilias Tsagklis","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-3-parsing-xml.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-3-parsing-xml.html"},"author":{"name":"Ilias Tsagklis","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/9a83496b285d30c61e8a674625c1350e"},"headline":"Android Full App, Part 3: Parsing the XML response","datePublished":"2010-10-26T20:26:00+00:00","dateModified":"2012-10-21T19:20:17+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-3-parsing-xml.html"},"wordCount":844,"commentCount":8,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-3-parsing-xml.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/android-logo.jpg","keywords":["Android Tutorial","Eclipse"],"articleSection":["Android Core"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-3-parsing-xml.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-3-parsing-xml.html","url":"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-3-parsing-xml.html","name":"Android Full App, Part 3: Parsing the XML response - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-3-parsing-xml.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-3-parsing-xml.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/android-logo.jpg","datePublished":"2010-10-26T20:26:00+00:00","dateModified":"2012-10-21T19:20:17+00:00","description":"This is the third part of the \u201cAndroid Full Application Tutorial\u201d series. The complete application aims to provide an easy way of performing movies\/actors","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-3-parsing-xml.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-3-parsing-xml.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-3-parsing-xml.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/android-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/android-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-3-parsing-xml.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Android","item":"https:\/\/www.javacodegeeks.com\/category\/android"},{"@type":"ListItem","position":3,"name":"Android Core","item":"https:\/\/www.javacodegeeks.com\/category\/android\/android-core"},{"@type":"ListItem","position":4,"name":"Android Full App, Part 3: Parsing the XML response"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/9a83496b285d30c61e8a674625c1350e","name":"Ilias Tsagklis","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/43505f28bb49f6e290c24be0b209ccc1af350f0f6587025ffd4847ef44bf6b78?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/43505f28bb49f6e290c24be0b209ccc1af350f0f6587025ffd4847ef44bf6b78?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/43505f28bb49f6e290c24be0b209ccc1af350f0f6587025ffd4847ef44bf6b78?s=96&d=mm&r=g","caption":"Ilias Tsagklis"},"description":"Ilias is a software developer turned online entrepreneur. He is co-founder and Executive Editor at Java Code Geeks.","sameAs":["http:\/\/www.iliastsagklis.com\/","https:\/\/www.linkedin.com\/in\/iliastsagklis"],"url":"https:\/\/www.javacodegeeks.com\/author\/ilias-tsagklis"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/316","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=316"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/316\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/46"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=316"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=316"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=316"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}