Android:扫描设备
我正在寻找一种扫描我所在地区的 Android 设备的方法。 它应该在没有互联网接入和 GPS 的情况下工作。 对于这个应用程序来说,只需知道 mac 地址就足够了。
我想到的第一个方法是使用蓝牙。 可以扫描蓝牙设备,但不可能使您自己的设备永远可见(Android 文档说这是可能的,但最多限制为 300 秒)。
接下来我想到的是扫描 wifi 网络。 几乎所有的安卓手机都使用wifi。
可以扫描 wifi 网络。 但是可以将我的设备设置为接入点吗? 它可以与系统软件一起使用,但我想以编程方式完成。
有人知道这是否可能吗?还有其他方法可以让设备“看到”彼此吗?
谢谢
I'm looking for a way to scan for android devices in my area.
It should work without internetaccess nor gps.
Just knowing the mac-address is enough for this app.
The first way I was thinking of was to use bluetooth.
It's possible to scan for bluetooth devices, but it isn't possible to make your own device visibile forever (Android docs say that's possible, but it's limited to max 300 seconds).
The next what came up in my mind was to scan for wifi networks.
Almost every android phone uses wifi.
It's possible to scan wifi networks.
But is it possible to set my device as an accesspoint?
It can with systemsoftware but I would like to do it programmatically.
Does someone know if that's possible? Is there another way to let devices 'see' eachother?
Thnx
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过反射可以做到这一点,但不推荐。但是您不能强迫其他人加入您的 Wifi 网络。这完全是他们的特权。
是的,可以看到网络上的其他设备。查看这些答案。如果您的 apk 安装在他们的设备上,您甚至可以尝试 WiFi 多播。
This is possible by reflection, but not recommended. However you cannot force others to join your Wifi network. That is entirely their prerogative.
Yes it is possible to see other device on the network. Check out these answers. If you have your apk installed on their device you can even try WiFi multicasting.