NetworkUtils

interface NetworkUtils(source)

Observes the default network for connectivity UI. CONNECTED does not prove validated Internet access or backend reachability; network operations must still handle failures.

See also

Functions

Link copied to clipboard
abstract fun getCurrentState(): Flow<NetworkState>

Returns a cold Flow that samples the active network's INTERNET capability before registering a default-network callback. Sampling and registration are not an atomic snapshot.