问题
I am developing an app in which the first thing i need is how to get devices that are connected to my wifi network or same wifi network .ie ip adress,device name etc. I don't have any idea how to do that have searched alot but there are no examples available.
I have done one thing that i will ping 255 ips and whichever will respond will be the connected ips but the problem here is that there are virtual ips already assigned to some websites so i need to detect only the real device ip addresses.
I want to do the same thing as done in the app WifiTalkie
回答1:
Follow Any one of the following:
Way1:
If you mean you want to see all the devices connected to your current WiFi connection (and you are not trying to do Ad Hoc networking), then you are essentially wanting to run a network scanner.
There are a bunch of these around. This one has the source available on github
http://rorist.github.com/android-network-discovery/
Way2: Refer How to detect all the Devices connected in a WiFi network from Android App
来源:https://stackoverflow.com/questions/44281905/get-devices-connected-to-same-wifi-network-in-android-programmatically