Answered by:
How to get Windows 8 Sureface(Tablet) Unique ID

Question
-
How to get Windows Surface unique Device ID(Windows RT and Windows Pro tablets). I tried below API but device ID is changing based on Bluetooth settings.
HardwareIdentification.getPackageSpecificToken(nonce)
Thanks in advance.
Wednesday, August 7, 2013 3:43 PM
Answers
-
- Proposed as answer by Sachin S Thursday, August 8, 2013 1:06 AM
- Marked as answer by Jamles HezModerator Wednesday, August 14, 2013 5:42 AM
Thursday, August 8, 2013 12:54 AM -
Hi Pradeep,
Let me explain to you why your ID changes.
Take a look at the document for HardwareIdentification.getPackageSpecificToken() method, the returned ASHWID will be different for each application package. In other words, this API will return different IDs when called by two apps from different packages.
Furthermore the ASHWID is generated using the components that make up the device:
- CPU ID of the processor
- Size of the memory
- Serial number of the disk device
- Network adapter (such as NIC MAC address)
- Audio adapter
- Docking station
- Bluetooth address
- Mobile broadband device ID
- BIOS
That's why your unique ID will change each time the bluetooth setting is changing.
Within this article you will be able to find your solution: http://msdn.microsoft.com/en-us/library/windows/apps/jj553431
Best Regards,
James He
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- Edited by Jamles HezModerator Thursday, August 8, 2013 1:40 AM update
- Marked as answer by Jamles HezModerator Wednesday, August 14, 2013 5:42 AM
Thursday, August 8, 2013 1:40 AMModerator -
Hi Pradeep,
I saw there is a best practice to use MAC address as the unique ID, we assume that all the device has at least one network adapter.
The code is below, and this will always keeps same unless you change your network adapter :
var networkProfiles = Windows.Networking.Connectivity.NetworkInformation.GetConnectionProfiles(); var adapter = networkProfiles[0].NetworkAdapter; string networkAdapterId = adapter.NetworkAdapterId.ToString();
Or you can ref to this discussion.
Hope this will help you and best regards,
James He
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- Edited by Jamles HezModerator Thursday, August 8, 2013 9:34 AM add discussion link
- Marked as answer by Jamles HezModerator Wednesday, August 14, 2013 5:39 AM
Thursday, August 8, 2013 6:14 AMModerator
All replies
-
- Proposed as answer by Sachin S Thursday, August 8, 2013 1:06 AM
- Marked as answer by Jamles HezModerator Wednesday, August 14, 2013 5:42 AM
Thursday, August 8, 2013 12:54 AM -
Hi Pradeep,
Let me explain to you why your ID changes.
Take a look at the document for HardwareIdentification.getPackageSpecificToken() method, the returned ASHWID will be different for each application package. In other words, this API will return different IDs when called by two apps from different packages.
Furthermore the ASHWID is generated using the components that make up the device:
- CPU ID of the processor
- Size of the memory
- Serial number of the disk device
- Network adapter (such as NIC MAC address)
- Audio adapter
- Docking station
- Bluetooth address
- Mobile broadband device ID
- BIOS
That's why your unique ID will change each time the bluetooth setting is changing.
Within this article you will be able to find your solution: http://msdn.microsoft.com/en-us/library/windows/apps/jj553431
Best Regards,
James He
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- Edited by Jamles HezModerator Thursday, August 8, 2013 1:40 AM update
- Marked as answer by Jamles HezModerator Wednesday, August 14, 2013 5:42 AM
Thursday, August 8, 2013 1:40 AMModerator -
Thanks for your reply.
I needed to pass the unique device id(Like Mobile IMEI number) to web server.
Do we have any other API's which should same in all settings?-Thanks
Thursday, August 8, 2013 5:31 AM -
Hi Pradeep,
I saw there is a best practice to use MAC address as the unique ID, we assume that all the device has at least one network adapter.
The code is below, and this will always keeps same unless you change your network adapter :
var networkProfiles = Windows.Networking.Connectivity.NetworkInformation.GetConnectionProfiles(); var adapter = networkProfiles[0].NetworkAdapter; string networkAdapterId = adapter.NetworkAdapterId.ToString();
Or you can ref to this discussion.
Hope this will help you and best regards,
James He
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- Edited by Jamles HezModerator Thursday, August 8, 2013 9:34 AM add discussion link
- Marked as answer by Jamles HezModerator Wednesday, August 14, 2013 5:39 AM
Thursday, August 8, 2013 6:14 AMModerator -
I have a user who is finding that ...NetworkAdapterId is the same for most of his 15 tablets he is putting my app on.
Phil
Wednesday, June 18, 2014 4:16 PM -
EasClientDeviceInformation.id uses a hash that include the UserId, so the value would change with different users. If you need a Device Id, this would not work.
The docs says: The Id property represents the DeviceId using the GUID truncated from the first 16 bytes of the SHA256 hash of the MachineID, User SID, and Package Family Name
Phil
Wednesday, June 18, 2014 4:25 PM -
hi,this is (EasClientDeviceInformation.Id)not working for tablets since its using windowsRT,Tuesday, September 30, 2014 5:28 AM