java-memidpcldcimei

Getting Device IMEI


How to get the IMEI of a Java ME device in a common way that is applicable to all devices


Solution

  • Usually, using java.lang.System.getProperty() can return the device IMEI.

    Unfortunately, the String parameter you need to use to get the IMEI will change from one handset manufacturer to the next.

    Strings to try:

    imei
    phone.imei
    com.lge.imei
    com.nokia.imei
    com.nokia.mid.imei
    com.siemens.imei
    com.sonyericsson.imei
    com.motorola.imei
    ...
    you get the idea.

    you may need to uppercase the last part of the string.

    the format of the result can change too.
    it can be a full imei with a "IMEI" prefix and 3 "-" in the middle of 17 digits.
    it can be a normalized imei of 13 or 15 digits...