title: Android get IP-Address of a hotspot providing device
body: <p>I'm currently using </p>
  
  <pre><code>public static String getLocalIPAddress(WifiManager wm){
      return Formatter.formatIpAddress(wm.getConnectionInfo().getIpAddress());
  }
  </code></pre>
  
  <p>to get the IP-Address of the executing devices. That works fine if the device is connected to a "common" wlan-network as well as the device is connected to a wifi network which is hosted by an other android device via hotspot. If the device is not connected to any wifi network "0.0.0.0" is returned (correct). But if the device is hosting a wifi network by providing a hotspot the methode is still returning "0.0.0.0". How can I get the real IP-Address of a hotspot providing device "in its own wifi-network"?</p>
  
  <p>thx &amp; regards </p>