How to get device IMEI number using JavaME for different vendors?
The International Mobile Equipment Identity (IMEI) is a number unique to every GSM, WCDMA, and iDEN mobile phone, as well as some satellite phones. It is usually found printed inside the battery compartment of the phone. It can also be displayed on the screen of the phone by entering *#06# into the keypad on most phones.
To retreive same information using JavaME is as follows:
As you all know that, MIDP (Mobile Information Device Profile) when combined with CLDC provides a Java Runtime Environment and a rich set of Java APIS for cell phones. MIDP defines some System properties that are available to the midlet with java.lang.System.getProperty(...) method. As IMEI is manufacturer specifc so there are few manufacturer specific APIs using which you can retrieve this info. Here's how to get IMEI number from mobile devices of different manufacturers:
- Nokia
- System.getProperty("phone.imei");
- System.getProperty("com.nokia.imei");
- System.getProperty("com.nokia.mid.imei"); //especially for S40 devices
- Sony Ericsson
- System.getProperty("com.sonyericsson.imei");
- Samsung
- System.getProperty("com.samsung.imei");
- Motorola
- System.getProperty("IMEI");
- System.getProperty("com.motorola.IMEI");
- Siemens
- System.getProperty("com.siemens.IMEI");
- LG
- System.getProperty("com.lge.imei");
In addition to this, there are some generic information about the device that can be retrieved by using System.getProperty(propertyString) method call, where value of propertyString can be vary as per your requirement. Few of them are listed as below:-
- microedition.profiles
- microedition.configuration
- microedition.locale
- microedition.platform
Very Descriptive Article!! It solved my problem. It was stuck in a problem and your article came as a God send solution to me.
ReplyDeleteThanks a lot and keep up the Good work.
You can get the IMEI Number by using the code *#06#..In here http://www.mobileunlocksolutions.com/unlock-your-phone/rs1wp2/ you can get the IMEI Details also Unlock code..
ReplyDeleteYep I agree. But over-here I am talking about get IMEI information using JavaME code and we can use that information our mobile application to implement some logic.
ReplyDeleteRegards,
Ashish
Hi. Does those codes really works well to get the imei?
ReplyDeleteThanks!
Hi,
ReplyDeleteYep it's working fine on the real device... using this code you are able to get the IMEI.
Best Regards,
Ashish Sharma.
I tried with all 3 ways of retriving IMEI in Nokia phones u have given. The phone I'm using is a Nokia 6120 classic. It regards to S60 FP 1. These codes return null for me. Any solutions?
ReplyDeleteThe Nokia 6120 classic(S60 3rd Edition, Feature Pack 1) is one of the many devices it doesn't work on. It was introduced in S60 3rd Edition, Feature Pack 2 (after the Nokia 6120 classic). The system property is available only on some Series 60 devices, not all. It doesn't necessarily work on all S60 3rd Edition Feature Pack 2 devices either, but it will work on some.
ReplyDeleteThanks for ur quick reply.
ReplyDeleteOne more question pls:
Signing my midlet will solve this problem?
The company I'm working now has no authorised CA. So Is it possible to signing my application using a self trusted certs. Suppose it is not, since the phone Im using (Nokia 6120) belongs to S60 3rd edition.
Yep on few devices to fetch the IMEI, we need to sign the MIDlet. But this signing needs to be done by vendor specific certificate. As you know we have Vendor specific Signing and Operator Specific Signing. Vendor Specific is for to access the API's support from specific vendor, whereas Operator specific is for to get the support for operator specific features (like accessing GPRS). Self Trusted Certificates will not resolve this issue.
ReplyDeleteWhat about Windows mobile, Android and blackberry phones. How will you go about getting there imei numbers?
ReplyDeleteHi,
ReplyDeleteRegarding IMEI on Windows Mobile - Please visit this link - http://goo.gl/omY6S
For Android Devices, I already posted an article for getting IMEI & you can find it here - http://goo.gl/8GJi
On Blackberry devices, Please visit the link for getting device unique ID - http://goo.gl/CkKPg
Hope I am able to answer your queries. Please let me know if you have any further queries.
Best Rergards,
Ashish Sharma.
Great article.. Can i get any property to get phone model??
ReplyDeleteYes, you can get device model using J2ME. You need to use System.getProperty("microedition.platform") property to get same. It'll return String value which has all the info. Device Model Number + Device OS info too.
ReplyDeleteNice Article but, Is there any Generic way to get IMEI Number???
ReplyDeleteI did some googling and also read this Article and find out the below solution but it is for device specific.
Nokia.>> System.getProperty("com.nokia.IMEI");
SonyEricsson>> System.getProperty("com.sonyericsson.imei");
Motorola>> System.getProperty("com.motorola.IMEI");
Is there any generic way to fetch IMEI for all devices??
The general property should be System.getProperty("phone.imei") or System.getProperty("imei"). But different vendor implement KVM differently. To fetch IMEI is totally depends upon the KVM implementation by device vendor, that's why you can see so many ways to get IMEI on different devices & which are not surely return you the value. On few devices to fetch the IMEI, we need to sign the MIDlet.
ReplyDelete