Wifi extension/available SSIDs

<<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?

Can it be modified to eliminate that permission?.

you might want to discuss this with Google...
see the documentation at App Inventor Extensions: WiFi | Pura Vida Apps

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."

Taifun

You're saying that location permission is a Google requirement for Scan Availables?

I seem to be missing where that is. I see the deprecated note.thx

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](

guide/topics/connectivity/companion-device-pairing).

Android 9:

A successful call to [ WifiManager.startScan() ]

eference/android/net/wifi/WifiManager#startScan()) requires all of the following conditions to be met:

permission.

  • Your app has the [ CHANGE_WIFI_STATE ]

m/reference/android/Manifest.permission#CHANGEE) permission.

  • Location services are enabled on the device (under Settings > Location

Android 10 (API level 29) and higher:

A successful call to

it always helps to add a link to that page...
also your copy got truncated somehow...

but it looks like you are confirming, that we need the location sensor (which adds ACCESS_FINE_LOCATION and,ACCESS_COARSE_LOCATION) and GPS enabled?

Taifun

The chat bot restricted my links bc I'm new....

ht veloper.android. /guide/topics/connectivity/companion-device-pairing#specify

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.

Implement companion

Does this mean you have a second phone that relays the scan to your main phone? This sounds ridiculous . It would seem to be something else

Companion seems to refer to a smart watch or similar. Ii guess I'll just request location permission

Is it possible to remove the location-permission request from the manifest (with an editor)?

I want to make the request separately when the user decides to use the functionality that accesses the available results

Thanks

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

Taifun

What then is the purpose of Call Screen.Ask for Permission ??

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

to edit the manifest see this thread

Taifun