locked
How to get Windows 8 Sureface(Tablet) Unique ID RRS feed

  • 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

  • You can use EasClientDeviceInformation.Id to get the unique device id.

    Thanks,
    Sachin
    My Samples

    • 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:

    1. CPU ID of the processor
    2. Size of the memory
    3. Serial number of the disk device
    4. Network adapter (such as NIC MAC address)
    5. Audio adapter
    6. Docking station
    7. Bluetooth address
    8. Mobile broadband device ID
    9. 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.


    Thursday, August 8, 2013 1:40 AM
    Moderator
  • 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.



    Thursday, August 8, 2013 6:14 AM
    Moderator

All replies

  • You can use EasClientDeviceInformation.Id to get the unique device id.

    Thanks,
    Sachin
    My Samples

    • 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:

    1. CPU ID of the processor
    2. Size of the memory
    3. Serial number of the disk device
    4. Network adapter (such as NIC MAC address)
    5. Audio adapter
    6. Docking station
    7. Bluetooth address
    8. Mobile broadband device ID
    9. 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.


    Thursday, August 8, 2013 1:40 AM
    Moderator
  • 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.



    Thursday, August 8, 2013 6:14 AM
    Moderator
  • 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