Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.
Checking network availability in Windows Phone
This article explains how to check the availability of network connection on Windows Phone.
Many applications utilize network connection for various purposes like feeds, sending & receiving data to/from server, etc. The following article explains how one can detect if the network connection is available or not.
Network API Information
- NetworkInterface Class helps in providing network information to the developers. It helps detect if the network is on/off, address etc.
- NetworkInterface::GetIsNetworkAvailable is used to check if the network connection is available.The network connection is considered to be available if interface is not in loopback or is marked as “up”.
- Namespace: System.Net.NetworkInformation
Example Code to understand the network connection
public partial class MainPage : PhoneApplicationPage
public static readonly DependencyProperty NetProperty =
string isNetworkAvail =
NetworkInterface.GetIsNetworkAvailable() ? "on" : "off";