Back to project page PictureBookReader.
The source code is released under:
GNU General Public License
If you think the Android project PictureBookReader 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 net.uyghurdev.avaroid.picturebookreader; // www . j a v a 2s .com import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import android.util.Log; public class NetWorkOperator { public String urlToString(String url) { // TODO Auto-generated method stub String str = ""; URL jurl; try { jurl = new URL(url); HttpURLConnection urlConn = (HttpURLConnection) jurl .openConnection(); InputStream inputStream = urlConn.getInputStream(); BufferedReader r = new BufferedReader(new InputStreamReader( inputStream)); StringBuilder total = new StringBuilder(); String line; while ((line = r.readLine()) != null) { total.append(line); } str = total.toString(); } catch (MalformedURLException e1) { // TODO Auto-generated catch block Log.d("Exep", e1.toString()); e1.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return str; } }