androidwifiandroid-wifi

Scan wifi APs without turn on Wifi? [Android]


Is it possible to scan wifi APs without turn on Wifi? I built an App that scan for wifi APs.. If wifi is disabled the app turn wifi on and off to scan. But I noticed a problem, when I was using my Smartphone as an Access Point and when the app turned on wifi my smartphone stopped being an Access Point.

If this is not possible and if there is no other way to do this I've to accept this "problem"..

Curiosity: Is it possible to turn on and off wifi without being "visible" for the user?


Solution

  • Even though in latest Android version (KitKat) there is an option for Scan-Only mode, it is impossible to obtain scan results with disabled WiFi. There is no way to make this totally hidden from user perspective. Howewer, with Scan-Only mode getting the scan results is basically an instant operation (since they are already available), so it would be hardly noticeable. Please note, this mode can be disabled.

    So, on your place I would just do the same thing: turn WiFi on, get scan results, turn WiFi off. Safe, convenient, compatible.

    As to the use case with AP (so called SoftAP) and WiFi (so called Station) at the same time - while working as WiFi engineer for one of the major Android phone OEM's, I'm not aware of any Android WiFi solution that is capable of running both SoftAP and Station at the same time. This is mostly due to technical limitations and power consumption of mobile phones.