Is there an easier fast way to detect whether the (Windows Phone 7) device has an internet connection.
I'm currently sending a web request, waiting the timeout period and handling the exception. Hoping for a quick easy way to query the device to see whether it has a connection before sending any requests...
Thanks in advance,
This method will return NetworkInterfaceType.None if there is no connection.
NetworkInterface.GetInternetInterfaceType
Alternatively you will get NetworkInterfaceType.MobileBroadbandGSM, NetworkInterfaceType.Wireless80211, etc if there is a connection.
There isn't really a faster way, though instead of a dummy request for this, perhaps you could actually make the request for data that you want, so if it does come back, you can handle the data without making a 2nd request.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With