Trying to pull and play an mp3 file from RSS feed in android app
<p>I'm trying to make an app for a podcast. My end  goal is for a user to be able to click on an episode in a list (which is generated from an RSS feed) and then have the audio play (which is also retrieved from the RSS feed) My problem is with parsing the XML from the RSS feed. I can't seem to figure out how to get the URL out of the enclosure tag for the mp3. Any help would be appreciated. Here is my parsing class</p>

<pre><code>private String data;
private ArrayList&lt;Episodes&gt; mEpisodes;

public ParseEpisodes(String xmlData) {
    this.data = xmlData;
    mEpisodes = new ArrayList&lt;&gt;();
}

public ArrayList&lt;Episodes&gt; getEpisodes() {
    return mEpisodes;
}

public boolean process(){
    boolean status = true;
    Episodes currentRecord = null;
    boolean inEntry = false;
    String textValue = "";
    String urlValue = "";

    try{
        XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
        factory.setNamespaceAware(true);
        XmlPullParser xpp = factory.newPullParser();
        xpp.setInput(new StringReader(this.data));
        int eventType = xpp.getEventType();

        while(eventType != XmlPullParser.END_DOCUMENT){
            String tagName = xpp.getName();
            switch(eventType){
                case XmlPullParser.START_TAG:
                   //Log.d("ParseEpisodes", "Starting tag for " + tagName);
                   if(tagName.equalsIgnoreCase("item")){
                       inEntry = true;
                       currentRecord = new Episodes();
                   }
                    break;

                case XmlPullParser.TEXT:
                    textValue = xpp.getText();
                    urlValue = xpp.getText();
                    break;


                case XmlPullParser.END_TAG:
                    //Log.d("ParseEpisodes", "Ending tag for " + tagName);
                    if(inEntry){
                        if(tagName.equalsIgnoreCase("item")){
                            mEpisodes.add(currentRecord);
                            inEntry = false;
                        }else if(tagName.equalsIgnoreCase("title")){
                            currentRecord.setTitle(textValue);
                        }else if(tagName.equalsIgnoreCase("enclosure")){
                            currentRecord.setLink(urlValue);
                        }

                    }
                    break;
            }
            eventType = xpp.next();
        }

    }catch (Exception e){
        status = false;
        e.printStackTrace();
    }


    return true;

}
</code></pre>

<p>here is the xml</p>

<pre><code>&lt;item&gt;
    &lt;title&gt;Episode 52 - Facebook Nukes The Show&lt;/title&gt;
    &lt;link&gt;https://greynoi.se/podcasts/episode-52-facebook-nukes-the-show&lt;/link&gt;    
    &lt;enclosure url="http://greynoi.se/episodes/ep79_m.mp3" length="43312404" type="audio/mpeg"/&gt;
    &lt;pubDate&gt;Fri, 15 Jul 2016 15:22:24 -0700&lt;/pubDate&gt;
    &lt;category&gt;1&lt;/category&gt;
    &lt;source url="https://greynoi.se"&gt;The GR3YNOISE Podcast&lt;/source&gt;
    &lt;itunes:subtitle&gt;Episode 52 - Facebook Nukes The Show&lt;/itunes:subtitle&gt;
    &lt;itunes:summary&gt;Episode 52 - Facebook Nukes The Show&lt;/itunes:summary&gt;
    &lt;content:encoded&gt;&lt;![CDATA[Episode 52 - Facebook Nukes The Show"}]]&gt;&lt;/content:encoded&gt;
    &lt;guid&gt;https://greynoi.se/podcasts/episode-52-facebook-nukes-the-show&lt;/guid&gt; 
&lt;/item&gt;
</code></pre>