We can get unique id by using telephony manager and android id.
But better to generate unique id by using both
TelephonyManager manager = (TelephonyManager)this.getSystemService(Context.TELEPHONY_SERVICE);
String imei = manager.getDeviceId();
String androidId =android.provider.Settings.Secure.getString(getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
UUID deviceUuid = new UUID(androidId.hashCode(), (imei.hashCode()<<32));
System.out.println("deviceUuid1 "+deviceUuid.toString());
No comments:
Post a Comment