collect

@RequiresPermission(value = "android.permission.ACCESS_NETWORK_STATE")
open suspend override fun collect(): NetworkInfo

Collects the current network connectivity status of the device.

This method checks if the device has an active internet connection by querying the system's connectivity manager. The implementation varies based on Android API level to ensure compatibility.

Return

NetworkInfo containing the current connectivity status

Throws