title: find internet ip address in android mobile programmatically , no need device ip address
body: <p>i am trying to get the Internet Ip Address in my mobile. no need for device ip address. that device is connected with wifi or 3g or 2g or anyway. that mobile is having internet facility means, i need that internet IP Address.</p>
  
  <p>Note : already i tried some coding. that code will work to get the device ip address only.</p>
  
  <p>my prev code :</p>
  
  <pre><code>try {
              for (Enumeration&lt;NetworkInterface&gt;
   en =  NetworkInterface.getNetworkInterfaces(); 
  en.hasMoreElements();) 
  {
                  NetworkInterface intf = en.nextElement();       
                  for (Enumeration&lt;InetAddress&gt;
   enumIpAddr = intf.getInetAddresses();enumIpAddr.hasMoreElements();) {
                      InetAddress inetAddress = enumIpAddr.nextElement();
                  if (!inetAddress.isLoopbackAddress())
                  { return inetAddress.getHostAddress().toString(); }      
                  }
                }
  
          }
    catch (SocketException ex) 
   { 
     Log.e("ServerActivity", ex.toString());
    }
  
  Another one code :
  
   WifiManager wifiManager = (WifiManager) getSystemService(WIFI_SERVICE);
      WifiInfo wifiInfo = wifiManager.getConnectionInfo();
      int ipAddress = wifiInfo.getIpAddress();
      Log.v("hari", "ipAddress:"+ipAddress);
  </code></pre>
  
  <p>Thanks Advance
  please any one help me..</p>