I need to scan for available Wi-Fi signals and their strengths. I'm using wifiManager.startScan();
and asynchronous wifiManager.getScanResult();
.
On devices without support of 5GHz band it takes about 500ms to get the results, on devices with 5GHz band support it takes about 2s, and that is too much for me. I guess the 1.5s delay is in searching the whole 5GHz band.
Is there any way I could tell the device to scan only in the 2.4GHz band, or any other way I could get the results faster (for example through NDK)? I searched through the entire web and found nothing, so I guess this is the only way.
Thank you.
From Notification Panel press and hold the WiFi icon until you enter WiFi settings screen. Select the network properties (tap the gear icon or menu icon). Depending on the Android version check: Read the “Frequency” setting – shows as 2.4 or 5GHz.
Check Device Settings Some devices have a setting that, when turned on, won't connect to 2.4 GHz Wi-Fi networks. The feature might have been intended to maximize the device's performance on Wi-Fi by using only 5 GHz, but it doesn't let you connect to the slower 2.4 GHz band.
The first place to start is with a Wi-Fi Scanner for your computer. These scan for wireless networks within range and tell you which channel they're running on, and the base frequency (2.4GHz or 5GHz).
It's actually part of the location services on your phone, meaning that it's scanning for networks to get a better idea of where you are at any given time. It sounds sinister, but it's the feature that allows services like Siri and Google Assistant to tell you about all the cool stuff in your immediate vicinity.
Is there any way I could tell the device to scan only in the 2.4GHz band
I think there is not way how to achieve it.
All you can do is only call startScan()
and wait for results. Then you can filter results due to their frequency especially for 2.4Ghz frequency of each AP (Access Point) should be bellow 2500 Mhz.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With