Xamarin Blog

An open source mobile platform for building Android, iOS, macOS, watchOS, and tvOS apps with .NET.

Easily Check Mobile Device Connectivity with Xamarin.Essentials

As a mobile app developer, it's great to be able to pull data from the server to our apps to provide users with a delightful experience. Of course, until your user puts their device on airplane mode or hits a rough patch with no cell reception. To provide the best user experience we need access to the current network state of our users' device. Better yet, be able to register for changes to that network state. Doing this will allow our mobile apps to react to different network conditions to provide users with instant feedback. With the connectivity API in Xamarin.Essentials, we can do just that with a few lines of code.