简体   繁体   English

Android现有的Wifi扫描

[英]Android exisiting Wifi Scan

I'm writing an app (which is currently unfinished) that should run in the background and scan for all the Wifis in range, using the WifiManager as usual, nothing special. 我正在编写一个应在后台运行的应用程序(当前未完成),并像往常一样使用WifiManager扫描范围内的所有Wifi,没什么特别的。

I was wondering: An Android device scans for Wifis every 5 seconds or so, to check for Saved Networks and connect automatically to one of them (probably the closest). 我在想:一个Android设备每5秒钟左右扫描一次Wifi,以检查“已保存的网络”并自动连接到其中一个(可能是最近的)。 Is there a way to use this existing Wifi Scan , so that I do not need to use my own and eventually slow down the phone because of 2 existing wifi scans? 有没有一种方法可以使用此现有的Wifi扫描,因此由于2个现有的wifi扫描,我不需要使用自己的Wifi扫描,最终可以降低手机的速度? Can I grab all the scanned Wifis once every 5 secs when the phone automatically scans? 手机自动扫描时,是否可以每5秒抓取一次所有已扫描的Wifi?

You can use this. 您可以使用它。 http://developer.android.com/reference/android/net/wifi/ScanResult.html http://developer.android.com/reference/android/net/wifi/ScanResult.html

to receive scan results. 接收扫描结果。

It gets WiFi Scan itself and you don't have to call getScan func. 它本身具有WiFi扫描功能,您无需调用getScan函数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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