5

Is there a way to get the name of your phone? The name you see in Windows Explorer properties as the device name?

I have looked at Microsoft.Phone.Info.DeviceStatus.DeviceName but that appears to be different. I have looked at DeviceExtendedProperties but that is mostly deprecated now.

The phone prompts you for this name during setup. I can also see this name and change it in the WinRT App for WP8 preferences. But I'm not seeing a way to get it by API.

(I would like this name so that I can pass it on to a web service that shows a device list)

Andy Weston
  • 157
  • 2
  • 7

4 Answers4

9

Windows.Networking.Proximity.PeerFinder.DisplayName will give you the name the user has given to the phone

Richard
  • 91
  • 1
  • 1
1

I don't think that the base API has anything that will allow you to do that, probably due to security concerns!

Pedro Lamas
  • 7,185
  • 4
  • 27
  • 35
  • Just curious, but why do you say it's a security concern? Note: I've never owned nor interacted with a WP8 device in this manner – Lander Jan 25 '13 at 22:48
  • I did turn on ID_CAP_IDENTITY_DEVICE but the DeviceName I'm seeing looks auto-generated ... RM-824_nam_att_101 for my Nokia. – Andy Weston Jan 25 '13 at 23:07
  • Just think of the people that name their device with their own first & last name!... Anything that can be used to uniquely identify a device and associate with a specific user IS a security concern, so that's why I think there is no away on getting the device name with the current SDK! – Pedro Lamas Jan 26 '13 at 18:28
1

This will give you the manufacturer and model name. For my Nokia Lumia 930, this logs "NOKIA RM-1045_1044" it's not the friendliest name but it'll let you differentiate between devices.

var deviceInformation = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation();
console.log(deviceInformation.systemSku);
Diego Mejia
  • 141
  • 8
0

There's no public WP8 API to retrieve the user friendly Device Name. If you're looking to uniquely identify the phone's use ANID2.

Community
  • 1
  • 1
JustinAngel
  • 16,082
  • 3
  • 44
  • 73
  • Thanks, I have been using the DeviceUniqueId for a key, I just wanted display name. Understandable if its locked down. Guess I can always prompt for one. – Andy Weston Jan 25 '13 at 23:50
  • Isn't Alexander's or Richard's answer correct technically? It works fine for me. – Arctic Jan 28 '14 at 13:15