i
This is not the latest version of this document; to access the latest version, click here.
Official Content

This API enables to check the network status of the devices in order to have more information to take some actions. This API is often used in Offline Native Mobile applications to determinate the best moment to perform a synchronization.

This API is componed by domains, properties and methods.

Domains

NetworkAPIConnectionType

This domain is defined in order to identify the device's connection type.

It is based on Numeric(1) with the following enumerated values:

Name Description Value
None None 0
Wifi Wifi 1
WAN WAN 2

Properties

ApplicationServerURL

It is a read-only property set automatically with the ServiceURL property of the Smart Devices Generator.

The property is then used by several methods explained below.

Methods

IsServerAvailable method

Returns true or false depending if the device can access the specified server. It checks if a package can be routed to the desired URL host; notice that no request is done to the current host.

The server can be passed as an optional parameter by its URL. If the URL parameter is not present then the method will check connection to the server url of the property ApplicationServerURL.

 

Parameters

Name Type Description
URL (optional) Character(200) URL of a specific server to which the devices has to check for access.

Return Value

Type Description
Boolean True or false whether the server is available or not.

Type method

It gets the connection type the device has to a specific server. There are some servers which are only accessed by Local Networks, so even though the device has internet connection they may not have access to the server

Parameters

Name Type Description
URL (optional) Character(200) URL of a specific server to which the device is trying to connect.

Return Value

Type Descripcion
NetworkAPIConnectionType One of the enumeration types of this domain which will be the connection type of the device to a specific server.

 

TrafficBasedCost method

Returns true or false whether the connection between the device and the server could cause a monetary cost to the device user

Parameters

Name Type Description
URL (optional) Character(200) URL of a specific server to which the device is trying to connect.

Return Value

Type Descripcion
Boolean Returns true or false if the network connection could cause a monetary cost to the device user

See also




Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant