getDeviceId

added in API level 1

public String getDeviceId ()


This method was deprecated in API level 26.


Use (@link getImei} which returns IMEI for GSM or (@link getMeid} which returns MEID for CDMA.


Returns the unique device ID, for example, the IMEI for GSM and the MEID or ESN for CDMA phones. Return null if device ID is not available.


Requires Permission: READ_PHONE_STATE or that the calling app has carrier privileges (see hasCarrierPrivileges()).


Returns

String