Back to project page RSSNewsReaderApp.
The source code is released under:
GNU General Public License
If you think the Android project RSSNewsReaderApp listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.romanostrechlis.rssnews.auxiliary; /* ww w.ja va 2s . com*/ import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; import android.os.AsyncTask; /** * RetrieveFeedTask implements the asynchronous functionality between application and servers. * * <p>RetrieveFeedTask extends {@link AsyncTask}. * * @author Romanos Trechlis */ class RetrieveFeedTask extends AsyncTask<String, Void, String> { protected String doInBackground(String... urls) { try { URL url= new URL(urls[0]); URLConnection urlCon = url.openConnection(); BufferedReader br = new BufferedReader(new InputStreamReader(urlCon.getInputStream())); StringBuilder sbResponse = new StringBuilder(); String sLine; while((sLine = br.readLine()) != null) { sbResponse.append(sLine); } String result = sbResponse.toString(); return result; } catch (Exception e) { e.printStackTrace(); return null; } } }