Gamebase SDK for Android  1.13.0
Toast Gamebase Platform
Gamebase.Network Class Reference

This class provides network status information. More...

Collaboration diagram for Gamebase.Network:
Collaboration graph

Static Public Member Functions

static boolean isConnected ()
 Indicates whether network connectivity exists and it is possible to establish connections and pass data. More...
 
static int getType ()
 Reports the type of network to which the info in this NetworkInfo pertains. More...
 
static String getTypeName ()
 Return a human-readable name describe the type of the network, for example "WIFI" or "MOBILE". More...
 
static boolean addOnChangedStatusListener (final NetworkManager.OnChangedStatusListener listener)
 Add the listener to be called when the network status is changed. More...
 
static boolean removeOnChangedStatusListener (final NetworkManager.OnChangedStatusListener listener)
 Remove the listener. More...
 

Detailed Description

This class provides network status information.

Member Function Documentation

◆ addOnChangedStatusListener()

static boolean addOnChangedStatusListener ( final NetworkManager.OnChangedStatusListener  listener)
static

Add the listener to be called when the network status is changed.

Since
Added 1.4.0.
Parameters
listenerThe listener to be invoked when the network status is changed.
Returns
True if listener registration succeeded, false otherwise.
Deprecated:
As of release 1.8.0, use Gamebase#addObserver(Observer) method instead.

◆ getType()

static int getType ( )
static

Reports the type of network to which the info in this NetworkInfo pertains.

Since
Added 1.4.0.
Returns
one of NetworkManager#TYPE_NOT, NetworkManager#TYPE_MOBILE,
NetworkManager#TYPE_WIFI, NetworkManager#TYPE_ANY,
or other types defined by NetworkManager.

◆ getTypeName()

static String getTypeName ( )
static

Return a human-readable name describe the type of the network, for example "WIFI" or "MOBILE".

Since
Added 1.4.0.
Returns
the name of the network type.

◆ isConnected()

static boolean isConnected ( )
static

Indicates whether network connectivity exists and it is possible to establish connections and pass data.

Since
Added 1.4.0.
Returns
true if network connectivity exists, false otherwise.

◆ removeOnChangedStatusListener()

static boolean removeOnChangedStatusListener ( final NetworkManager.OnChangedStatusListener  listener)
static

Remove the listener.

Since
Added 1.4.0.
Parameters
listenerThe listener to be removed.
Returns
True if listener unregistration succeeded, false otherwise.
Deprecated:
As of release 1.8.0, use Gamebase#removeObserver(Observer) method instead.