PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • WiFi connection information
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Returns information regarding the current connection to data on the mobile network.
Remark: This function cannot be used in the simulator and it will return 0 in this case.
Versions 18 and later
Android Widget This function is now available in Android widget mode.
New in version 18
Android Widget This function is now available in Android widget mode.
Android Widget This function is now available in Android widget mode.
Versions 22 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
iPhone/iPad This function is now available for iPhone/iPad applications.
New in version 22
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
iPhone/iPad This function is now available for iPhone/iPad applications.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
iPhone/iPad This function is now available for iPhone/iPad applications.
Example
// Activate the Wi-Fi if the signal intensity is strong enough to access the data
// via the mobile network
IF Val(MobileNetworkConnectionInfo(networkGSMSignal)) <= 20 _AND_ WiFiStatus() <> wifiEnabled THEN
IF YesNo("The intensity of the GSM signal is not sufficient. Enable the Wi-Fi?") THEN
WiFiActivate()
END
END
Syntax
<Result> = MobileNetworkConnectionInfo(<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:
    1. <Type of network>
    2. <Operator>
    3. <GSM signal>
    4. <Roaming>
    5. <Plane mode>
<Type of information>: Integer
Requested information:
networkRoamingData roaming mode.
If this information is requested, <Result> is set to:
  • "1" if the current connection uses data roaming
  • "0" otherwise.
iPhone/iPad This constant is not available.
networkAirPlaneModeManagement of plane mode.
If this information is requested, <Result> is set to:
  • "1" if the device is in airplane mode.
  • "0" otherwise.
Universal Windows 10 AppiPhone/iPad This constant is not available.
networkOperatorName of the network operator used.
Depending on the type of network or if the plane mode is enabled, this information may not be specified.
If no SIM card is found, this information may correspond to an operator name if the phone is "Sim-locked".
networkGSMSignalGSM signal strength between "0" (no signal) and "100" (optimal signal).
iPhone/iPad This constant is not available.
networkTypeType of network used to access the data on the mobile network.
Data roaming mode.
If this information is requested, <Result> is set to:
  • network2G: 2G network
  • networkEdge: Edge network
  • network3G: 3G network
  • network4G: 4G network
  • Versions 27 and later
    network5G: 5G network
    New in version 27
    network5G: 5G network
    network5G: 5G network
  • networkUnknown: Unknown network (or SIM card not found).
Remarks

WiFi connection information

To get information about the WiFi connection, use WiFiConnectionInfo.
Versions 25 and later
Android Required permissions
Calling this function changes the permissions required by the application.
The ACCESS_COARSE_LOCATION permission is added: this permission allows an application to access an undefined location (Cell-ID, WiFi).
Android 10 specific case: Android 10 has implemented a new permission for the functions that allow locating the device: ACCESS_BACKGROUND_LOCATION.
This permission allows using the function when the application is in the background.
When this permission is added to the application, a window allows the user to:
  • 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.
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:
  • Manually add the "ACCESS_BACKGROUND_LOCATION" permission in the Android application generation wizard.
  • Explicitly request background location permission with PermissionRequest. For example:
    PermissionRequest(permBackgroundLocation, Callback)
    INTERNAL PROCÉDURE Callback(p is Permission)
    IF p.Granted THEN
    // Functions that require background location access can be used
    END
    END
A window allows users to:
  • 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.

Remarks:
  • 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.
New in version 25
Android Required permissions
Calling this function changes the permissions required by the application.
The ACCESS_COARSE_LOCATION permission is added: this permission allows an application to access an undefined location (Cell-ID, WiFi).
Android 10 specific case: Android 10 has implemented a new permission for the functions that allow locating the device: ACCESS_BACKGROUND_LOCATION.
This permission allows using the function when the application is in the background.
When this permission is added to the application, a window allows the user to:
  • 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.
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:
  • Manually add the "ACCESS_BACKGROUND_LOCATION" permission in the Android application generation wizard.
  • Explicitly request background location permission with PermissionRequest. For example:
    PermissionRequest(permBackgroundLocation, Callback)
    INTERNAL PROCÉDURE Callback(p is Permission)
    IF p.Granted THEN
    // Functions that require background location access can be used
    END
    END
A window allows users to:
  • 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.

Remarks:
  • 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.
Android Required permissions
Calling this function changes the permissions required by the application.
The ACCESS_COARSE_LOCATION permission is added: this permission allows an application to access an undefined location (Cell-ID, WiFi).
Android 10 specific case: Android 10 has implemented a new permission for the functions that allow locating the device: ACCESS_BACKGROUND_LOCATION.
This permission allows using the function when the application is in the background.
When this permission is added to the application, a window allows the user to:
  • 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.
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:
  • Manually add the "ACCESS_BACKGROUND_LOCATION" permission in the Android application generation wizard.
  • Explicitly request background location permission with PermissionRequest. For example:
    PermissionRequest(permBackgroundLocation, Callback)
    INTERNAL PROCÉDURE Callback(p is Permission)
    IF p.Granted THEN
    // Functions that require background location access can be used
    END
    END
A window allows users to:
  • 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.

Remarks:
  • 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.
Related Examples:
WM_System Cross-platform examples (WINDEV Mobile): WM_System
[ + ] This application is an example of some of the features of WINDEV Mobile available for Android/iOS.
The following system functions are used:
- NFC
- Multimedia control
- Brightness
- Volume
- Wi-Fi
- Bluetooth
- Toast
- Compass
- Accelerometer
- Camera control
- LED
- Vibration
- Notifications
- Drawing functions
- Internet
Component: wd270android.aar
Minimum version required
  • Version 17
This page is also available for…
Comments
Click [Add] to post a comment