Windows Phone 8 Get device Name

Source: Internet
Author: User

By using the Microsoft.Phone.Info.DeviceStatus class, we can get some information about the device, such as the device manufacturer, the device name, and so on. The name of the device can be obtained through Microsoft.Phone.Info.DeviceStatus.DeviceName, but this name is usually not the device name that we are familiar with, but the device identity name. For example: Lumia520, through the above interface to obtain the device identification is "rm-914_apac_prc_227", we are more familiar with the "Lumia520", and for direct access through the interface "rm-914_apac_prc_227" is indeed very unfamiliar, If you need to display the device name in our program, then we need to display a name like "Lumia520" instead of a string that is obtained directly from the API. Then you need a conversion interface to convert the strings acquired by the API into familiar device names.

There is a great God abroad has encapsulated such a conversion interface, interface name and: Phonenameresolver (Https://github.com/ailon/PhoneNameResolver). You can download your child's shoes on your own, just import the PhoneNameResolver.cs file into your existing project. Use the sample code as follows:

Looking at the code of the Phonenameresolver class, this interface maintains a corresponding relational table, and when a new device is released, the foreign god will update the interface, which means that the project using this interface needs to be updated synchronously, otherwise there will be a problem with the name of the new device.

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.