Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows Phone 8 network information

I am trying to get some information about the network like Network type, Network status, Cell ID, MCC, MNC, LAC, BID, NID, SID, Signal strength, Operator name.

The only thing I can get now is the mobile operator name using:

  using Microsoft.Phone.Net.NetworkInformation;
  System.Text.StringBuilder sb = new System.Text.StringBuilder();            

  sb.Append("Mobile operator:  ");
  sb.AppendLine(DeviceNetworkInformation.CellularMobileOperator);

Like that I can get if WiFi is available, roaming available, just true or false. Is there any solution to get some of the other information, network type for example if it's GSM - CDMA for example?

Also looking for the wifi network list, spots available and get the list.

like image 342
Bozow Avatar asked Dec 20 '12 09:12

Bozow


1 Answers

You can only get information for the currently connected network interfaces, not any other hotspots or cellular towers or their signal strength. You can't force the phone to change the connections either.

You can tell if you're on GSM or CDMA or WiFi and at what speed you're connected, and whether you're roaming.

See this page on MSDN, and specifically this linked page for a walk-through of the available APIs.

You can get the Network type (GSM/CDMA/WiFi) from Microsoft.Phone.Net.NetworkInformation.NetworkType (see here).

The code snippet to get the NetworkInformation objects is:

private void UpdateNetworkInterfaces()
{
    NetworkInterfaces.Clear();
    NetworkInterfaceList networkInterfaceList = new NetworkInterfaceList();
    foreach (NetworkInterfaceInfo networkInterfaceInfo in networkInterfaceList)
    {
        NetworkInterfaces.Add(networkInterfaceInfo.InterfaceName);
    }
}
like image 83
Paul Annetts Avatar answered Oct 12 '22 17:10

Paul Annetts