Question

enter image description here

final TelephonyManager tm = (TelephonyManager) getBaseContext().getSystemService(Context.TELEPHONY_SERVICE);
        final String tmDevice, tmSerial, androidId;
        tmDevice = "" + tm.getDeviceId();
        tmSerial = "" + tm.getSimSerialNumber();

TextView lblVersion= (TextView)findViewById(R.id.txtDeviceID);
        lblVersion.setText("Device ID : "+tmDevice);

i get device ID is null, why?

No correct solution

OTHER TIPS

There are many things which people call a "device ID". Development device ID is different from what you get from TelephonyManager.getDeviceId() (and also different from Secure.ANDROID_ID). This Google Groups post seems to have done some research and narrowed it down to this code and related comment:

Returns the device identity that verifiers can use to associate their scheme to a particular device. This should not be used by anything other than a package verifier.

In short, don't try to use the Development Device ID. Use a different ID instead.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top