Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting Device IMEI

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

like image 728
Prabhu R Avatar asked Mar 25 '09 09:03

Prabhu R


2 Answers

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...

like image 92
michael aubert Avatar answered Sep 23 '22 06:09

michael aubert


there is no standard way to get the IMEI via Java ME. some phones expose the IMEI as a system property, but others don't or require the midlet to be signed to operator or manufacturer domain (ie. not by you).

like image 32
ax. Avatar answered Sep 23 '22 06:09

ax.