I want to make an android app to find the IP address of all the connected devices connected on the same wifi. I tried this :
for (int i = lower; i <= upper; i++) {
String host = subnet + i;
try {
InetAddress inetAddress = InetAddress.getByName(host);
if (inetAddress.isReachable(timeout)){
publishProgress(inetAddress.toString());
}
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
But it can get only the connected mobile phone's IP, not the pc's. How to get the connected pc's IP address also?