Scanning WiFi network without internet access on Android 10

Viewed 103

Using Android 10, it is difficult to scan Wifi Access Point with no internet access.

I use the following code to scan Wifi networks:

IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION);
registerReceiver(wifiNetworkScanner, intentFilter);

WifiManager wifiManager = (WifiManager) getApplicationContext().getSystemService(WIFI_SERVICE);
wifiManager.startScan();

with wifiNetworkScanner extending BroadcastReceiver and using wifiManager.getScanResults();

The scan results properly include Wifi Access Point with internet access, but most of the time, Access Point without internet access are not scanned on Android 10.

Is it a bug on Android 10 ? Any workaround ?

0 Answers
Related