Get IP Address of pc from android device programmatically
<p>I have connected my PC wired to the router, whereas my android device is wirelessly connected to the same router.</p>

<p>I need to access the  nodejs server running on my machine from my app. I need to retrieve IP Address of the machine in Android app.</p>

<p>I have tried this code</p>

<pre><code>    WifiManager wm = (WifiManager) getSystemService(WIFI_SERVICE);
    String ip =  Formatter.formatIpAddress(wm.getConnectionInfo().getIpAddress());
    return ip;
</code></pre>

<p>ipconfig commands displays 192.168.1.100, whereas in code its returns 192.168.1.103 ....How do I make it get the IP Address of the machine in my app?</p>