mavericksunny
mavericksunny

Reputation: 11

Query regarding the DeviceID

There are 2 queries: First I was able to retrieve the DeviceUniqueID from the DeviceExtendedProperties. It gives me a byte array of 20 bytes in length. I was only able to convert it into a base64 string to make it readable. What is the actual way to make the byte array readable ? Second I registered my WP7 device using ActiveSync and the deviceID that i received from the device was XXXXXXXXXXXXXXXXXXXXXXXXXXDFA720 which consists of 32 characters. It is not same as the DeviceUniqueID. How can I get this deviceID from the device ?

Upvotes: 1

Views: 1577

Answers (2)

Matt Lacey
Matt Lacey

Reputation: 65586

Wndows Phone 7 does not work with ActiveSync (or Windows Mobile Device Center).

Your 32 char ID is probably the ANID or Anonymized ID (see http://msdn.microsoft.com/en-us/library/microsoft.phone.info.userextendedproperties.trygetvalue(v=VS.92).aspx)

Upvotes: 1

Derek Lakin
Derek Lakin

Reputation: 16319

I use the following code to get the DeviceUniqueId as a formatted string:

/// <summary>
/// Gets the unique identifier for the device.
/// </summary>
/// <returns>A string representation of the unique device identifier.
public static string GetDeviceId()
{
    byte[] uniqueId = (byte[])DeviceExtendedProperties.GetValue("DeviceUniqueId");
    return BitConverter.ToString(uniqueId);
}

Not sure what you mean about using ActiveSync with WP7 devices. If you can give me some more details to repro, I might be able to help further.

Upvotes: 3

Related Questions