Code example for XmlPullParser

Methods: getTextnextnextTagrequire

        return link;
    // Processes summary tags in the feed. 
    private String readSummary(XmlPullParser parser) throws IOException, XmlPullParserException {
        parser.require(XmlPullParser.START_TAG, ns, "summary");
        String summary = readText(parser);
        parser.require(XmlPullParser.END_TAG, ns, "summary");
        return summary;
    // For the tags title and summary, extracts their text values. 
    private String readText(XmlPullParser parser) throws IOException, XmlPullParserException {
        String result = "";
        if ( == XmlPullParser.TEXT) {
            result = parser.getText();
        return result;
    // Skips tags the parser isn't interested in. Uses depth to handle nested tags. i.e., 
Connect your IDE to all the code out there  Get Codota for Java