In french: WiFiInfoConnexion
Returns the requested information about the current Wi-Fi connection of the device.
Info(StringBuild("Your current connection speed is %1 Mbps", ...
<Result> = WiFiConnectionInfo([<Type of information>])
<Result>: Character string
- Requested information. If several types of information are requested, each type of information is separated by a CR character (Carriage Return).
The order in which the information is returned (if requested) is as follows: wifiSSID + wifiBSSID + wifiIPAddress + wifiMacAddress + wifiSpeed + wifiIDNetwork
- Empty string ("") if the device is not connected to a Wi-Fi access point. The ErrorOccurred variable is set to True. ErrorInfo returns more information on the error.
<Type of information>: Optional Integer constant
|Full information about the connection (corresponds to wifiSSID + wifiBSSID + wifiIPAddress + wifiMacAddress + wifiSpeed + wifiIDNetwork).|
|wifiBSSID||BSSID (Basic Service Set Identifier) of the access point of the connection.|
- Identifier of the network to which the device is connected,
- Empty string ("") if the device is connected to no identified network.
|wifiIPAddress||IP address associated with the connection.|
|wifiMACAddress||Wi-Fi Mac address of the device.|
Caution: From Android SDK version 6, the Mac address returned has the following format "02:00:00:00:00:00".
|wifiSpeed||Speed of the Wi-Fi link (expressed in Mbps).|
|wifiSSID||SSID (Service Set Identifier) of the Wi-Fi network to which the device is connected.|
Calling this function changes the permissions required by the application.
Required permissions :
- ACCESS_WIFI_STATE: This permission allows the applications to access information regarding the Wi-Fi networks.
- ACCESS_FINE_LOCATION: This permission allows the application to access precise device location.
Android 11 specific case:
This function requires the ACCESS_BACKGROUND_LOCATION permission to access the device's location.
This permission allows using the function when the application is in the background.
If the application needs to use background location:
A window allows users to:
- Manually add the "ACCESS_BACKGROUND_LOCATION" permission in the Android application generation wizard.
- Explicitly request background location permission with PermissionRequest. For example:
INTERNAL PROCEDURE Callback(p is Permission)
IF p.Granted THEN
// Functions that require background location access can be used
- allow access to the device location while the application is in the background,
- allow access to the location only while the application is in use,
- deny access to the location. The user can also change these permissions at any time in the Android settings.
- Follow Google's guidelines for applications that require background location access. For more details, see https://support.google.com/googleplay/android-developer/answer/9799150. If these conditions are not met (especially user information requirements), applications may not be accepted for publication on Google Play.
- The background location permission should only be requested if the location permission has been granted. Otherwise, PermissionRequest will fail.
- If the option chosen by the user for the background location access request is more restrictive than the option chosen for the location access request, the application will be automatically restarted.
- On devices running Android 10 or earlier, if location permission has been granted to the application, the background location permission will be granted without displaying a window.
This page is also available for…