I'm using this code to get the ID of the Android device.
TelephonyManager telephonyManager = (TelephonyManager) getActivity().getBaseContext().getSystemService(Context.TELEPHONY_SERVICE);
id = telephonyManager.getDeviceId();
But now I noticed that in some cases, ID was written as null
.
- I'm not sure about getting ID this way?
- Under what circumstances does this return null?