picview/src/com/google/android/apps/picview/request/CachedWebRequestFetcher.java
public String fetchFromWeb(URL url) {
    Log.d(TAG, "Fetching from web: " + url.toString());
    try {
      HttpURLConnection conn = (HttpURLConnection) url.openConnection();
      conn.setUseCaches(false);
      conn.setReadTimeout(30000); // 30 seconds.
      conn.setDoInput(true);
      conn.connect();
      InputStream is = conn.getInputStream();
      return readStringFromStream(is);
    } catch (IOException e) {
      e.printStackTrace();
    }
    return null;
  }
/**
   * Fetches the given URL from the web.
   */
Fetches the given URL from the web.
Fetches the given URL from the web .
public String fetchFromWeb(URL url) {
    Log.d(TAG, "Fetching from web: " + url.toString());
    try {
      HttpURLConnection conn = (HttpURLConnection) url.openConnection();
      conn.setUseCaches(false);
      conn.setReadTimeout(30000); 
      conn.setDoInput(true);
      conn.connect();
      InputStream is = conn.getInputStream();
      return readStringFromStream(is);
    } catch (IOException e) {
      e.printStackTrace();
    }
    return null;
  }
public String fetchFromWeb ( URL url ) { Log . d ( TAG , "Fetching from web: " + url . toString ( ) ) ; try { HttpURLConnection conn = ( HttpURLConnection ) url . openConnection ( ) ; conn . setUseCaches ( false ) ; conn . setReadTimeout ( 30000 ) ; conn . setDoInput ( true ) ; conn . connect ( ) ; InputStream is = conn . getInputStream ( ) ; return readStringFromStream ( is ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return null ; }
Fetches the given URL from the web.
Fetches the given URL from the web .
// 30 seconds.