network
This class provides network setting information(ip, dns(domain name server) address, gateway address etc.) and methods which can set these.
Add the following line for network class into a html file your own : <script type="text/javascript" src="$MANAGER_WIDGET/Common/webapi/1.0/webapis.js"></script> |
You can declare network class like this : ex) var network = webapis.network; |
Contents
Methods
getAvailableNetworks | ||
Description | ||
Get all the available network interfaces. These network interfaces can be through a Wi-Fi, Cellular or Wired (Ethernet) network. | ||
Parameters | ■successCallback
- Function - To be invoked when the network interfaces have been successfully retrieved, passing the newly created NetworkArray object. ■errorCallback (Optional) - Function - To be invoked if an error occurred. | |
Return | ■Void | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
try {
webapis.network.getAvailableNetworks(successCB, errorCB); } catch (error) { console.log(error.name); } |