During the development of Windows Phone, we need to obtain some information about the mobile Phone. The following lists how to obtain some common information about the mobile Phone.
I. device screen information
Double width = Application. Current. Host. Content. ActualWidth;
Double heigth = Application. Current. Host. Content. ActualHeight;
2. device information (Microsoft. Phone. Info)
1.Device vendor
String DeviceManufacturer = DeviceStatus. DeviceManufacturer;
2.Device Name
String DeviceName = DeviceStatus. DeviceName;
3.DeviceID
Byte [] result = null;
Object uniqueId;
If (DeviceExtendedProperties. TryGetValue ("DeviceUniqueId", out uniqueId ))
{
Result = (byte []) uniqueId;
}
// Convert the device ID to a string
String DeviceUniqueId = Convert. ToBase64String (result );
4.Firmware Version
String DeviceFirmwareVersion = DeviceStatus. DeviceFirmwareVersion;
5.Hardware version
String DeviceHardwareVersion = DeviceStatus. DeviceHardwareVersion;
6.Total memory
Long DeviceTotalMemory = DeviceStatus. DeviceTotalMemory;
7.Memory Used by the application
Long ApplicationCurrentMemoryUsage = DeviceStatus. ApplicationCurrentMemoryUsage;
8.Application memory usage peak
Long ApplicationPeakMemoryUsage = DeviceStatus. ApplicationPeakMemoryUsage;
9. operating system version
String osversion = System. Environment. OSVersion. Version. ToString ();
Iii. Network Status
1.Obtain whether the Network is available
Bool flag = Microsoft. Phone. Net. NetworkInformation. NetworkInterface. GetIsNetworkAvailable ();
2.Obtain the current mobile phone network type
Microsoft. Phone. Net. NetworkInformation. NetworkInterface. NetworkInterfaceType
Wireless80211 is wifi
None indicates no network connection.
MobileBroadbandGsm is a gsm 2G network connection.
MobileBroadbandCdma is a CDMA Unicom 3g
Ethernet-connecting to a computer
3.Obtain whether the network connection is enabled.
Bool flag = Microsoft. Phone. Net. NetworkInformation. DeviceNetworkInformation. IsNetworkAvailable;
4.Obtain whether to enableWifi
Bool flag = Microsoft. Phone. Net. NetworkInformation. DeviceNetworkInformation. IsWiFiEnabled;