Onur
Onur

Reputation: 347

Why does WiFi Scanning on Android take different times with different phones

android.net.wifi.WifiManager has the startScan() method to perform a passive scan of the WiFi channel and when the scanning is completed onReceive() method is called to access the WiFi channel readings.

However, as this webpage shows, which I have also confirmed with my own code implementation, the passive scanning of the WiFi channels take different times with different phones. Sometimes, some platforms are even around 10 times slower..

I would like to know what causes the phones to use so much time. Is it the driver? Is it some energy saving features? Or none of them and something very different is the reason?

Upvotes: 2

Views: 2261

Answers (1)

iheanyi
iheanyi

Reputation: 3113

The article gives you a hint:

Passive scans are slower to perform, because the device needs to listen on every channel for some period of time, waiting for broadcast beacons. Beacon frames are transmitted by APs periodically to announce the presence of a wireless LAN. Beacon frames contain all the information about its network. This approach consumes less energy, since the radio doesn't use transceiver, but only the receiver. It also takes more time to finish, since it has to listen on every channel.

Some period of time is different for each device. If you listen for too short a time on a channel, you might miss a beacon frame. Too long and it might take a while to enumerate all the available APs when the user first scans a new location.

Furthermore, I didn't see actual details on how those results were generated. One might imagine a smart algorithm would use a longer listen time when first in a new location but switch to shorter ones after it's been there for a while.

Upvotes: 1

Related Questions