Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Revision as of 06:49, 30 July 2013 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Getting IMEI and IMSI in Java ME

From Wiki
Jump to: navigation, search
Article Metadata
Article
Created: prssupe (09 May 2011)
Last edited: hamishwillee (30 Jul 2013)

Importance of IMEI and IMSI : The IMEI and IMSI can be used to ensure extra security while user make use of your application For e.g if you want manager should access his account from valid phone provided by organization.This two codes can be proven effective.

The code will work in almost all devices.

public String getIMEI() {
String out = "";
try {
out = System.getProperty("com.imei");
if (out == null || out.equals("null") || out.equals("")) {
out = System.getProperty("phone.imei");
}
if (out == null || out.equals("null") || out.equals("")) {
out = System.getProperty("com.nokia.IMEI");
}
if (out == null || out.equals("null") || out.equals("")) {
out = System.getProperty("com.nokia.mid.imei");
}
if (out == null || out.equals("null") || out.equals("")) {
out = System.getProperty("com.sonyericsson.imei");
}
 
if (out == null || out.equals("null") || out.equals("")) {
out = System.getProperty("IMEI");
}
if (out == null || out.equals("null") || out.equals("")) {
out = System.getProperty("com.motorola.IMEI");
}
 
if (out == null || out.equals("null") || out.equals("")) {
out = System.getProperty("com.samsung.imei");
}
if (out == null || out.equals("null") || out.equals("")) {
out = System.getProperty("com.siemens.imei");
}
 
if (out == null || out.equals("null") || out.equals("")) {
out = System.getProperty("imei");
}
 
} catch (Exception e) {
return out == null ? "" : out;
}
return out == null ? "" : out;
}
//code for getting IMSI of the phone
public String getIMSI() {
String out = "";
try {
out = System.getProperty("IMSI");
if (out == null || out.equals("null") || out.equals("")) {
out = System.getProperty("phone.imsi");
}
if (out == null || out.equals("null") || out.equals("")) {
out = System.getProperty("com.nokia.mid.mobinfo.IMSI");
}
if (out == null || out.equals("null") || out.equals("")) {
out = System.getProperty("com.nokia.mid.imsi");
}
if (out == null || out.equals("null") || out.equals("")) {
out = System.getProperty("IMSI");
}
if (out == null || out.equals("null") || out.equals("")) {
out = System.getProperty("imsi");
}
} catch (Exception e) {
return out == null ? "" : out;
}
return out == null ? "" : out;
}
This page was last modified on 30 July 2013, at 06:49.
90 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×