Handling no network condition
The network conditions in mobile devices are uncertain. Sometimes, a user manually disables the network connections or they are unavailable due to various external reasons. For applications that use network data, you must handle different network states. Applications should react gracefully by showing an appropriate message to the user.
In POIApp, before starting the download, we must confirm the availability of the network data connections. If the network is unavailable, we should notify the user with an appropriate message otherwise continue with the download request.
The ConnectivityManager class present in the System.Net package can be used to query the state of device network connectivity. This class can also be ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access