Search code examples
androidwifi

How does the WifiAnalyzer app get WiFi scan results without requesting for GPS?


I thought that, in order to get Wifi scan results, you need to ask for coarse permissions and to activate GPS to get it working (from Android 6.0.)

But the thing is that I have just checked that on Android 7.0, WifiAnalyzer achieves this information without asking for GPS. How is this possible?


Solution

  • As of now the only way to get the wifi scans without turning on the GPS is to set the app's

    targetSDKVersion to 21 or lower.

    This works regardless of the device's os being Lolipop or above.