Get Devices connected to same wifi network in android programmatically?

偶尔善良 提交于 2019-12-25 18:38:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!