fipcurren88
fipcurren88

Reputation: 701

UWP - How to get device model

I need to know my device model when my app running.

I try many ways to get that like:

string[] properties = { "System.Devices.ModelName"}; await PnpObject.FindAllAsync(PnpObjectType.DeviceContainer, properties);

or new EasClientDeviceInformation().SystemProductName;

But both never return my device model, like Lumia 640. On desktop it works fine but on mobile not.

Any ideas to solve my problem?

Thanks

Upvotes: 2

Views: 1846

Answers (1)

AVK
AVK

Reputation: 3923

Lumia Models are not the actual Model Names. For example my Lumia 640 is RM-1073. But one of my friend who uses a Carrier Locked Lumia 640 phone model is RM-1072.

You can get this info using

var clientDeviceInformation = new EasClientDeviceInformation();
string systemProductName = clientDeviceInformation.SystemProductName;

There is a way to receive Lumia Model Number too. If the phone's Name is never changed, it will still have the original Name. You can retrieve that using

string friendlyName = clientDeviceInformation.FriendlyName;

However there might be very few people who does not change their phone's name.

Upvotes: 2

Related Questions