Windows Phone 7 : Checking Network Connections before Downloading

Windows Phone 7 : Checking Network Connections before Downloading

  • Comments 0

Not every user will use unlimited data connections. So as a good application developer you should check and notify user whether they would like to proceed further or not.

Some of the quick things you may want to do

//Check if network is available
var _isNetworkAvailable = Microsoft.Phone.Net.NetworkInformation.DeviceNetworkInformation.IsNetworkAvailable;

//Check if Cell Data connection is available
var _isCellDataAvailable = Microsoft.Phone.Net.NetworkInformation.DeviceNetworkInformation.IsCellularDataEnabled;

//Check if the cell data connection is in ROaming
var _isCellDataRoaming = Microsoft.Phone.Net.NetworkInformation.DeviceNetworkInformation.IsCellularDataRoamingEnabled;

//Check if WiFi Network is available
var _isWiFiEnabled = Microsoft.Phone.Net.NetworkInformation.DeviceNetworkInformation.IsWiFiEnabled;

You can also check who is the mobile provider, a quick one to let user know if they are in Roaming and not using their parent connection

Microsoft.Phone.Net.NetworkInformation.DeviceNetworkInformation.CellularMobileOperator;

Namoskar!!!

Leave a Comment
  • Please add 1 and 4 and type the answer here:
  • Post