Android Wifimanager::getscanresults() Still Returns Empty List
As a newbie to Android programming, I am trying to get the SSID list using WifiManager's getScanResults() method, but it remains empty, even though I have granted it the ACCESS_COA
Solution 1:
Starting from Android 6, you have to enable location services in order to get desired results. Granting permissions is just the half work done.
You can also fire an intent to redirect user to this setting:
IntentmyIntent=newIntent( Settings.ACTION_LOCATION_SOURCE_SETTINGS);
startActivity(myIntent);
Location services are necessary because when you access the scan results, you can access the information like BSSID (address of the access point). This information can also be used to detect the location of device. By requiring location services, OS ensures that user understands their location information is being accessed when they use your app.
Post a Comment for "Android Wifimanager::getscanresults() Still Returns Empty List"