0
votes

Is there a way to extract the same information displayed in the Settings|About in a Windows Phone 8.1 (WINRT) Universal App?

I've been googling for a while but to no avail, well I'm wondering if it's because I'm running this in the emulator.

I'm interested in checking what information I can extract from the device simply from a curiosity point of view, but I really would like to be able to extract the Name (as displayed as the first line below the "Phone Information" title).

I've tried the following:

Windows.System.UserProfile.UserInformation.GetFirstNameAsync();
Windows.System.UserProfile.UserInformation.GetFirstNameAsync();
Windows.System.UserProfile.UserInformation.GetDisplayNameAsync();
...

I've also tried the following:

Windows.Devices.Enumeration.DeviceInformation.

and loop through all the returned items (i.e. 113) but it didn't provide anything really related to the About|Setting|User Information.

I ran the above in my emulator and directly on my phone but all the UserInformation functions are returning me blank values.

Any ideas?

Thanks.

1

1 Answers

0
votes

You can't really get these (esp. on the phone). If you check the related MSDN pages you can see:

https://msdn.microsoft.com/en-us/library/windows/apps/windows.system.userprofile.userinformation.aspx - for example the GetLastName method remarks contain: "Access to the user's last name can be blocked by privacy settings (for example, if the UserInformation::NameAccessAllowed property is false). If access is blocked, this method returns an empty string."

Also the DeviceInformation class is more for finding attached devices to the PC (eg.: like printer helper apps): https://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.enumeration.deviceinformation