Hey guys I am unable to get device Id for the device with dual sim.I am getting device as null for devices with dual sim slots(<5.1 os)
Below is my code to get device Id
public static String getImeiNumber(Context context) {
try {
if (context != null) {
TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
if (telephonyManager != null) {
Log.d(TAG, "Device ID" + telephonyManager.getDeviceId());
return telephonyManager.getDeviceId();
}
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
Here I am retrieving Device Id with help of telephony manager
.