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
  • Special cases
  • Required permissions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Adds a new network to the list of Wi-Fi networks configured on the device. Then, WiFiConnect is used to connect the device to the added Wi-Fi network.
Note: 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
Identifiant is string 
Identifiant = WiFiAddNetwork("SSID", "BSSID", wifiSecurityWPA, "mdp", True)
IF Identifiant <> " "  THEN
	WiFiConnect(Identifiant)
END
Syntax
<Result> = WiFiAddNetwork(<SSID> , <BSSID> , <Security> [, <Key> [, <Permanent>]])
<Result>: Character string
  • Network identifier of the new network.
  • Empty string if the network was not created. ErrorInfo returns more information on the error.
Note: If the added network matches a network already configured on the device, <Result>corresponds to the identifier of the existing network.
<SSID>: Character string
SSID (Service Set Identifier) of Wi-Fi network.
<BSSID>: Character string
BSSID (Basic Service Set Identifier) of the access point associated with the network.
<Security>: Character String constant
Type of security used by the Wi-Fi network:
wifiSecurityIEEE8021XSecurity that uses the IEEE 802.1x standard.
wifiSecurityNoneNo security is used.
wifiSecurityWEPSecurity based on a WEP key (Wired Equivalent Privacy)
wifiSecurityWPA2Security that uses the WPA2 mechanism (Wi-Fi Protected Access).
wifiSecurityWPASecurity that uses the WPA mechanism (Wi-Fi Protected Access).
wifiSecurityWPA_EAPSecurity that uses the WPA mechanism (Wi-Fi Protected Access) and the EAP mechanism (Extensible Authentication Protocol).
<Key>: Optional string or Secret string
Key used to connect to the secured network. The key is mandatory if the type of the specified security protocol is WPA or WPA2.
New in version 2025
Secret strings: If you use the secret string vault, the type of secret string used for this parameter must be "ANSI or Unicode string".
To learn more about secret strings and how to use the vault, see Secret string vault.
New in version 2025
AndroidAndroid Widget Secret strings are not available for this parameter in Android/Android widget applications.
<Permanent>: Optional boolean
Indicates whether the addition of the network is permanent:
  • True: the added network will be permanently stored on the device.
  • False (default): the added network will not be retained the next time the device is rebooted.
Remarks

Special cases

  • If the added network is permanently stored on the device (<Permanent> set to True), the identifiers assigned to each one of the networks can be modified after WiFiAddNetwork is executed. Use WiFiListNetwork to find out the new identifiers.
  • To delete a network from the list of networks configured on the device, use WiFiDeleteNetwork.

Required permissions

This function changes the permissions required by the application.
Required permissions:
  • ACCESS_WIFI_STATE: enables applications to access information about Wi-Fi networks.
  • CHANGE_WIFI_STATE: allows applications to change Wi-Fi connectivity status.
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: 05/16/2025

Send a report | Local help