简体   繁体   中英

Get Devices connected to same wifi network in android programmatically?

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM