I'm trying to create a server that will host a game that can be played with android devices in the same network. I create the server like this
InetAddress addr = InetAddress.getLocalHost();
server = new ServerSocket(4456,50,addr);
System.out.println(server.getInetAddress());
and when i print the ip, i get 192.168.1.7. The problem is that when i use getLocalHost(); on Android emulator(the one that comes with Android Studio)or a normal android device, the ip i get is 127.0.0.1 How can i get the localHost ip from the server that is hosted on Windows?