title: How to get the system ip address after usb tethering of android phone?
body: <p><br>I'm developing a mobile application in android.
    <br>Here I want to detect the IP address of the computer,system,etc after the usb tethering of the any android phone
    <br>I cannot find the solution.
    <br>If I put the following code then it takes the only the IP address of phone ,I need IP address of system</p>
  
  <p>The following are code</p>
  
  <pre><code>  ArrayList&lt;InetAddress&gt; arrayList=new ArrayList&lt;InetAddress&gt;();
  
          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();
                      arrayList.add(inetAddress);
                      inetAddress=null;
                  }
              }
          } catch (SocketException ex) {
              Log.e("SALMAN", ex.toString());
          }
          return arrayList;
  </code></pre>
  
  <p><br>Please help me to get the system's IP address,If we cannot able to get means so please mention me. Because I'm new to android.</p>
  
  <p><br>I'm using android 1.6 .
  <br><br>
  <br>There is server side application in the windows xp system. That application is a windows service which is developed by C# .net.
  <br>That windows service listen to some port such like 234,etc.If some data comes to port then it will process the data and send response through that port.</p>
  
  <p><br>In android the android application is send the data to the windows service via socket.
  <br>The android phone is USB tethered  to the system in which windows service is running.Then system assume android phone is modem and additional IP address is generated for the system.This ip  address is dynamically generated when the android phone is tethered.
  <br>For data transfer form mobile to system via socket .I will need to give the ip address of the system (after tethered) in my android coding.
  <br>If there is any method in android coding to get this IP address.
  <br>All are please give your ideas on regarding this.</p>