Code example for HttpGet

0
  } 
   
  private void updateForecast(Location loc) {
    String url=String.format(format, loc.getLatitude(),
                             loc.getLongitude());
    HttpGet getMethod=new HttpGet(url);
     
    try { 
      ResponseHandler<String> responseHandler=new BasicResponseHandler();
      String responseBody=client.execute(getMethod,
                                         responseHandler);
      buildForecasts(responseBody);
       
      String page=generatePage();
     
      browser.loadDataWithBaseURL(null, page, "text/html",
                                  "UTF-8", null); 
    } 
    catch (Throwable t) {
      android.util.Log.e("WeatherDemo", "Exception fetching data", t);
      Toast