Getting Device IMEI
Asked Answered
G

4

8

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

Gatewood answered 25/3, 2009 at 9:10 Comment(0)
U
6

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

Unskillful answered 25/3, 2009 at 10:34 Comment(1)
I have tried all 8 Strings but I always get Null, is there a complete reference or library that can do that and run on any mobile ????Backwoodsman
H
3

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

Hungry answered 25/3, 2009 at 10:31 Comment(0)
L
2

In the game i'm developing, to get an unique id for every cellphone (so that they can't duplicate and share savefiles) i use the bluetooth mac address that is different for every single bluetooth device and the java code to get it is the same on every device =D

Landlord answered 29/10, 2009 at 20:52 Comment(1)
Thanks Ricardo, however you need the JSRs that support bluetooth on that phoneGatewood
G
0

I have tried what is suggested by both ax and quickrecipeonsymbianos however they both solve the purpose in an elegant way. However, in the BlackBerry we have the getDeviceID() to get the unique id of the device, but Java ME lacks this functionality

Gatewood answered 25/3, 2009 at 10:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.