Connectivity Info
The library allows listen state type of bearer used by this network configuration.
Permissions
Permissions=Internet
Dependency libraries
Qt5CoreQt5Network
Features:
- State is online.
- Listen change state.
Example
var states: MutableMap<ULong, ConnectivityInfoState> = mutableMapOf()
class AuroraConnectivityInfo {
fun isOnline(): Boolean {
return ConnectivityInfo.isOnline()
}
fun listen(): ULong {
return ConnectivityInfo.listen { id, value ->
states.put(id, value)
}
}
fun getState(id: ULong): String {
return states[id]?.name ?: "-"
}
}