title: how can i get my external / ip?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/6064510/how-to-get-ip-address-of-the-device">How to get ip address of the device?</a>  </p>
  </blockquote>
  
  
  
  <p>Below is a snippet of how I am trying to get the external IP. However, it does not return anything... </p>
  
  <pre><code>public String getIpAddress() {
  
      try {
              HttpClient httpclient = new DefaultHttpClient();
              HttpGet httpget = new HttpGet("http://www.whatismyip.com/?404");
              // HttpGet httpget = new HttpGet("http://whatismyip.com.au/");
              // HttpGet httpget = new HttpGet("http://www.whatismyip.org/");
              HttpResponse response;
  
              response = httpclient.execute(httpget);
  
              //Log.i("externalip",response.getStatusLine().toString());
  
              HttpEntity entity = response.getEntity();
              entity.getContentLength();
              str = EntityUtils.toString(entity);
      }
      catch (Exception e)
      {
      }
      return str;
  
  }
  </code></pre>