以编程方式将设备连接到Android中的同一wifi网络? [英] Get Devices connected to same wifi network in android programmatically?

查看:181
本文介绍了以编程方式将设备连接到Android中的同一wifi网络?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,其中我需要做的第一件事就是如何获取连接到我的wifi网络或相同wifi网络的设备.例如ip地址,设备名称等. 我不知道如何进行搜索,但是没有可用的示例.

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.

我已经做过一件事,我将ping 255个ip,无论响应的是连接的ip,但是这里的问题是已经有虚拟ip分配给某些网站,所以我只需要检测真实的设备ip地址.

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.

我想做的事与在应用程序WifiTalkie中所做的一样

I want to do the same thing as done in the app WifiTalkie

推荐答案

请遵循以下任一条件:

方式1:

如果您是想查看连接到当前WiFi连接的所有设备(并且您不想进行Ad Hoc网络连接),那么您实质上是想运行网络扫描仪.

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.

周围有很多这样的东西.这有一个在github上可用的源代码

There are a bunch of these around. This one has the source available on github

http://rorist.github.com/android-network-discovery/

方式2: 请参阅如何检测通过Android App在WiFi网络中连接的所有设备

这篇关于以编程方式将设备连接到Android中的同一wifi网络?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆