How to get Ip address of other devices connected to switch network via Wifi programmatically?

653 views Asked by At

In my project I need to get the ip address of the two different network that is connected to the switch for example my device ip is 192.168.2.5 and my printer ip address is 10.1.7.5

I need to detect the printer ip address from my devices programmatically in android.

1

There are 1 answers

2
Andrey  Kopeyko On

There are only 2 ways of solving your problem:

1) Your printer must register it IPv4 address somewhere. For example, in dynamic DNS zone with a predefined name. Then you can lookup this name there and get it IP addr.

2) If your switch is smart enough (eg, is manageable one), You can login into it interface (ssh or web) and scan through MAC address table. In this case you must know printer MAC to look for.