Windows Phone device information

Source: Internet
Author: User

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;

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.