import syeef.com.*;
public class JavaScript {
//

How to get Unique Device ID with WinJS on WP8.1

This example shows how to get Unique Device ID with WinJS on Windows Phone 8.1:


function createDeviceId() {
var deviceId = "";
var packageSpecificToken =
Windows.System.Profile.HardwareIdentification
.getPackageSpecificToken(null);
var hardwareId = packageSpecificToken.id;
var dataReader =
Windows.Storage.Streams.DataReader
.fromBuffer(hardwareId);

var array = new Array(hardwareId.length);
dataReader.readBytes(array);
for (var i = 0; i < array.length; i++) {
deviceId += array[i].toString();
}
return deviceId;
}
}