<<Try your AvailableSSID.aia with the wifi extension on it, and worked well.>>
I have used the wifi extension TaifunWifi1 - first, without the Available SSIDs data, and it works. When I add Available SSIDs, it then requires location permissions. I don't see any reason for that requirement in general, and not specifically here because the return of AvailSSIDs has only the name and mac address. Is there a reason for requiring loc permission for it?
Get a list of available SSIDs (Service Set Identifiers). WiFi must be enabled for this.
Note : to be able to test this block, you have to build the app, because the permission CHANGE_WIFI_STATE is not available in the companion app.
Note : Precondition to use this method is to add a location sensor component into your project. Also GPS must be enabled. See the example project about how to use it..
Note : Android will get more and more restricted. In a future Android release the AvailableSSIDs method will stop working, see also this note in the Android documentation: "The ability for apps to trigger scan requests will be removed in a future release."
you are correct, I also can not find it anymore in the Android documentation...
just do not follow that note and try it without location sensor and without GPS...
Note : Precondition to use this method is to add a location sensor component into your project. Also GPS must be enabled. See the example project about how to use it..
let us know what you find out...
Taifun
PS: before SDK26 the method already worked without that... probably now it is working again?
(Had to delete links . Chopped it up a bit. This is on developer site
Permissions
Note: In each of the following sections that mention location permissions or location-gathering logic, keep in mind that, when your app is running in the background, access to location should be critical to the core functionality of the app and is accompanied with proper disclosure to users
Android 8.0 and Android 8.1:
A successful call to WifiManager.getScanResults() requires any one of the following permissions:
ACCESS_FINE_LOCATION
ACCESS_COARSE_LOCATION
CHANGE_WIFI_STATE
If the calling app does not have any of these permissions, the call fails with a SecurityException.
Alternatively, on devices
Alternatively, on devices running Android 8.0 (API level 26) and higher, you can use the CompanionDeviceManager to perform a scan of nearby companion devices on behalf of your app without requiring the location permission. For more on this option, see [Companion device pairing](
This Companion looks interesting, but i don't understand it......
Companion device pairing
On devices running Android 8.0 (API level 26) and higher, companion device pairing performs a Bluetooth or Wi-Fi scan of nearby devices on behalf of your app without requiring the [ ACCESS_FINE_LOCATION ](ht
eloper.androi. /reference/android/Manifest.permission#ACCESS_FINE_LOCATION) permission. This helps maximize user privacy protections. After the device is paired, the device can leverage the [ REQUEST_COMPANION_RUN_IN_BACKGROUND ](ht. developer.andro. /reference/android/Manifest.permission#REQUEST_COMPANION_RUN_IN_BACKGROUND) and [ REQUEST_COMPANION_USE_DATA_IN_BACKGROUND ](ht oper.android.com/reference/android/Manifest.permission#REQUEST_COMPANION_USE_DATA_IN_BACKGROUND) permissions to start the app from the background. Use this method to perform the initial configuration of the companion device, such as a BLE-capable smart watch.
Companion device pairing doesn't create connections on its own. Bluetooth and Wi-Fi connectivity APIs establish connections. Nor does companion device pairing enable continuous scanning.
A user can select a device from a list and grant it permission to access an app. These permissions are revoked if you uninstall the app or call disassociate(). An app is responsible for clearing its own associations if the user no longer needs them, such as when they log out or remove bonded devices.
for the functionality to work, you will need the corresponding permissions in the manifest...
without these you will not be able to use the method AvailableSSIDs
one thing are the list of permissions in the manifest, another thing is to ask for permissions... you only can ask for those permissions, which have been listed in the manifest
however afaik for the location sensor the permissions will be asked automatically on starting the app?
if you do not like that, you could remove the location sensor from the project, edit the manifest to add the permissions (ACCESS_FINE_LOCATION and,ACCESS_COARSE_LOCATION) manually and use the AskForPermission method to ask for those permissions before using the AvailableSSIDs method