isConnected

open fun isConnected(): Boolean

Checks if the host device has an active network connection.

Return

true if the host has network connection, otherwise false.


open fun isConnected(allowedTypes: Array<Int>): Boolean

Checks if the host device is connected to the using one of the allowed network type.

Return

true if the host is connecting using an allowed network type, otherwise false.

Parameters

allowedTypes

array of allowed network types.


open fun isConnected(networkEntitlements: SparseArray<Boolean>): Boolean

Checks if the host device is connected to the using one of the allowed network type.

Return

true if the host is connecting using an allowed network type, otherwise false.

Parameters

networkEntitlements

a SparseArray of NetworkType and Boolean values that indicate whether a specific network type can be used.


open fun isConnected(networkInfo: NetworkInfo, networkEntitlements: SparseArray<Boolean>): Boolean

Checks if the specified network is one of the allowed network type.

Return

true if the host is connecting using an allowed network type, otherwise false.

Parameters

networkInfo

the current network information.

networkEntitlements

a SparseArray of NetworkType and Boolean values that indicate whether a specific network type can be used.