UniqueID optimized for android device
<p>I am trying to generate a unique id for android phones and tablets. I found an interesting function but with my brand new galaxy tab 2 it does not work. Here is my function :</p>

<pre><code>public String generateId(TelephonyManager tm, ContentResolver resolver) {
    final String tmDevice, tmSerial, androidId;
    tmDevice  = "" + tm.getDeviceId();
    tmSerial  = "" + tm.getSimSerialNumber();
    androidId = "" + Secure.getString(resolver, Secure.ANDROID_ID);
    UUID deviceUuid = new UUID(androidId.hashCode(), ((long)tmDevice.hashCode() &lt;&lt; 32) | tmSerial.hashCode());
    return deviceUuid.toString();
}
</code></pre>
