The Network external object allows you to check the devices' network status in order to have more information to take some actions. This API is often used in Offline Native Mobile applications to determine the best moment to perform a synchronization.
This external object must be used in a Client-side Event (like the ClientStart event) because it is executed on the user's device and not on the server. Errors may occur if you use it in Server-side Events.
It is a read-only property set automatically with the Services URL property of the Smart Devices Generator.
The property is then used by several methods explained below.
Returns True if the device can access the specified server; otherwise, it returns False. It checks if a package can be routed to the desired URL host; note that no request is made to the current host. The server can be passed as an optional parameter in its URL. If the URL parameter is not present then the method will check the connection to the server URL of the property ApplicationServerURL.
Return value |
Boolean |
Parameters |
[ Url:URL ] |
Gets the connection type that the device has to a specific server. There are some servers that are only accessed by local networks.
Return value |
NetworkAPIConnectionType |
Parameters |
[ Url:URL ] |
Returns true or false depending on whether the connection between the device and the server could cause a monetary cost to the device user.
Return value |
Boolean |
Parameters |
|
It allows you to change the application URL dynamically. To do so, set the Dynamic Services URL property to True.
Return value |
None |
Parameters |
[ Url:URL ] |
Note: In iOS it is available as of GeneXus 16 upgrade 3, and in Android as of GeneXus 16 upgrade 7.
Notifies when the network status changes.
This domain is defined to identify the device's connection type.
It is based on Numeric(1) with the following enumerated values:
None |
No connection. |
Wifi |
Wi-Fi connection. |
WAN |
WAN connection. |
Generators: Android, Apple
Coding your Data Synchronization programs
Manual Synchronization Code Sample