Getting Windows Phone version and device name in Windows Phone 8.1 XAML
Asked Answered
B

3

22

In Windows Phone 8 Silverlight I use

 Environment.OSVersion.ToString()

to get Windows Phone version and

DeviceStatus.DeviceManufacturer+" "+DeviceStatus.DeviceName

to get device name.

These APIs no longer work with Windows Phone 8.1 XAML. I have found

Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation()

this seems to return the manufacturer and device name but OS is returned as just "Windows Phone".

Is there a way to get the exact Windows phone version?

Beachhead answered 9/6, 2014 at 14:5 Comment(5)
From what I've read, getting the version does not seem to be possible. May I ask why do you need it?Upsydaisy
The documentation msdn.microsoft.com/en-us/library/… and msdn.microsoft.com/EN-US/library/windowsphone/develop/… says that it is supported in Windows Phone 8.1 XAML.Bischoff
@Upsydaisy for an API call, they use it for some analyticsBeachhead
@Bischoff works with 8.1 Silverlight but not 8.1 XAMLBeachhead
Did you ask the people with the API about this? They might have some idea. Also, for now you could just pass 8.1. Yeah, that's not a real solution, but I don't know if such exists.Upsydaisy
P
5

This is currently not possible In Windows Runtime 8.1 (Phone and Windows). It does look like it might be planned thanks to Morten Nielsen and Pete Brown

EDIT: This is now possible in Windows 10. See this SO answer as well as this article for more useful features.

Perretta answered 9/6, 2014 at 15:17 Comment(2)
and what about https://mcmap.net/q/658296/-how-to-detect-windows-phone-8-1-os-version-programmatically ? shouldn't I use that?Chronaxie
Firmware version is not OS version. There are many different version for a particular OS. While The main OS is 8.1, the actual version used depends on what updates MS or the carrier has pushed out.Perretta
S
2

For 8.1, you can use this project on Github https://github.com/Microsoft/phone-info that includes an example application for retrieving both static and dynamic properties of a Windows Phone device.

For Windows 10, the APIs that were used to gather these data on (8 and 8.1) have changed. I have found one blog post https://www.suchan.cz/2015/08/uwp-quick-tip-getting-device-os-and-app-info/ for someone who has created a helper class that retrieves the following properties from a Windows 10 UWP app

current OS family - phone/desktop/...

current OS build number - 10.0.10240.16413

current OS architecture - x86/x64/ARM

current App Display Name

current App Version - 3.0.2.0

current Device manufacturer - Nokia

current Device model - Lumia 1520

In his post he shows how to get basic data about current device, operating system and application.

give it a try maybe it helps

Sworn answered 6/12, 2015 at 7:27 Comment(3)
Thanks, but my question is about 8.1 so this is not a solution for me.Beachhead
for 8.1 you can use the DeviceStatus Properties under the DeviceStatus class in the Microsoft.Phone.Info NamespaceSworn
@IgorKulman I edited the answer to include 8.1 let me know if that does the job.Sworn
M
1

In Windows Phone 8.1:

Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation().FriendlyName

It worked for me!

Melicent answered 16/1, 2015 at 18:42 Comment(4)
That only returns the name of the device, not the OS version as asked for.Addictive
You also have the following properties:Id, OperatingSystem, SystemSku, SystemProductName, SystemManufacturer, SystemHardwareVersion, SystemFirmwareVersion, SystemFirmwareVersionMelicent
Oh. you're right it hasn't the versión numbre. SorryMelicent
None these say Windows 8.1 or the extended version number, nor the devicenameMatadi

© 2022 - 2024 — McMap. All rights reserved.