Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public interface NetworkTypeListener
Receives notifications when the device’s active network changes type
(WiFi <-> Cellular <-> Ethernet <-> None <-> VPN). Register with
NetworkManager.addNetworkTypeListener(NetworkTypeListener).
Implementations are invoked on the EDT.
Methods
public abstract void onNetworkTypeChanged(int oldType, int newType, boolean vpnActive) | Called when the platform transitions between network classes. |
Method details
onNetworkTypeChanged
public abstract void onNetworkTypeChanged(int oldType, int newType, boolean vpnActive)Called when the platform transitions between network classes.
Parameters
oldTypeint- one of
NetworkManager.NETWORK_TYPE_* newTypeint- one of
NetworkManager.NETWORK_TYPE_* vpnActivebooleantrueif the platform reports a VPN tunnel on top of the active network. May befalseon platforms where VPN detection is unsupported (seeNetworkManager.isVPNDetectionSupported()).