ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Communication / WiFi functions
  • Required permissions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
WiFiActivate (Function)
In french: WiFiActive
Enables or disables Wi-Fi on the device.
Remarks:
  • To find out the activation status of Wi-Fi on the device or to be notified when the status changes, use WiFiStatus.
  • The Wi-Fi access is not available in the Android emulator.
AndroidAndroid Widget Please note: This feature is available only up to Android 9.. From Android 10, this information is no longer available. Using this function causes a fatal error. It is recommended to test the Android version used via SysAndroidVersion.
Example
IF Val(SysAndroidVersion(sysVersionNumber))<10 THEN  
	IF WiFiStatus() = wifiDisabled THEN
		WiFiActivate(True)
	END
END
Syntax
<Result> = WiFiActivate([<Wi-Fi activation>])
<Result>: Integer constant
Activation status of Wi-Fi after the modification:
wifiActivationInProgressThe Wi-Fi is being enabled on the device.
wifiDeactivationInProgressThe Wi-Fi is being disabled on the device.
wifiDisabledThe Wi-Fi is disabled on the device.
wifiEnabledThe Wi-Fi is enabled on the device.
wifiErrorThe activation status of Wi-Fi cannot be retrieved.
<Wi-Fi activation>: Optional boolean
New activation status of Wi-Fi:
  • True (default): Enables Wi-Fi on the device.
  • False Disables Wi-Fi on the device.
Remarks

Required permissions

This function changes the permissions required by the application.
Required permissions:
  • ACCESS_WIFI_STATE: this permission allows applications to access information about Wi-Fi networks.
  • CHANGE_WIFI_STATE: this permission allows applications to change the Wi-Fi connectivity state.
  • WAKE_LOCK: this permission lets you use PowerManager WakeLocks to prevent the processor from going to sleep or the screen from graying.
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: wd300android.jar
Minimum version required
  • Version 16
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help