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

Detecting Network Connection with Xamarin

$
0
0

Ok this took alot of searching around to finally figure out to do this. Considering I have never developed on Android or with Xamarin and im still learning it all.

this page http://developer.xamarin.com/recipes/android/networking/networkinfo/detect_network_connection/ Shows a way that does not work for me at all.

I had to do this:

var connectivityManager = (ConnectivityManager)Forms.Context.ApplicationContext.GetSystemService(Context.ConnectivityService);

And another part that took me a little while to figure it is going to the android properties and then to the manifest and selecting ACCESS_NETWORK_STATE and ACCESS_WIFI_STATE.

There wasnt a link i found that put all this together. So i thought i'd post it for other mobile noobs.


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>