Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 89864

Best (and fastest) way to check if internet connection is ok (Android only)

$
0
0

I'm wondering what's the best way to check if internet connection is working properly. Right now I'm using Xamarin.Essentials Connectivity.NetworkAccess to determine if the device is connected to the internet, however, there is a disclaimer saying that it doesn't check all things or might be unreliable. There's also another plugin Xam.Plugin.Connectivity (both developed by James Montemagno) and I'm not sure which one I should use.. The latter seems to have more options like e.g. pinging remote host. Or maybe I should use some Android specific method? What is the fastest (and most trustworthy) way to check it?
Besides, when should I check the connection - before sending request to web api or only when it causes web exception? Of course doing it beforehand seems to be best approach, but if it's time-consuming process (checking connection) then it might make no sense to do it for each and every request..


Viewing all articles
Browse latest Browse all 89864

Trending Articles