25

How can I get both IMEI numbers from dual SIM mobile? Can anyone help me to resolve this problem.

Screenshot of a dual-SIM mobile phone

Filburt
  • 16,221
  • 12
  • 59
  • 107
VenkaReddy
  • 2,811
  • 2
  • 25
  • 29
  • IMEI is defined for a device not for a SIM card! So your question has no sense. See wiki: http://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity – Marek R Aug 09 '12 at 10:03
  • 3
    Once can you please check dual sim mobile. Each sim slot has a unique IMEI number. I checked just now. – VenkaReddy Aug 09 '12 at 10:07
  • 2
    Dual SIM phones are quite rare, but I believe you and I'm surprised that each SIM slot has own IMEI. Anyway I don't see public API to handle two SIMs in Android so probably you have to find some device specific libraries. http://stackoverflow.com/questions/5255147/dual-sim-card-android – Marek R Aug 09 '12 at 10:20
  • @Marek R... Now i updated the question with screen shot. – VenkaReddy Aug 09 '12 at 10:22
  • [Here is complete solution for what you are looking for](http://stackoverflow.com/a/17499889/703851) – Vaibhav Jani Jul 06 '13 at 06:02
  • 1
    You **can** get 2 different IMEIs in case of Dual SIM devices. Refer **[this answer](http://stackoverflow.com/a/17499889/840669 "this answer")** by [Pied Piper](http://stackoverflow.com/users/703851/pied-piper) to get 2 different IMEIs for dual SIM phones. – Rajkiran Jul 11 '13 at 10:45

2 Answers2

3

Any information regarding SIM #2 (or any other then default SIM) is purely manufacturer dependent. Android does not provide APIs for multi-SIM facility. Android apis only support default SIM Card slot. You can contact Micromax (device manufacturer) if he can provide you apis to support his hardware component.

Kishore
  • 922
  • 2
  • 9
  • 29
1

You can try the following code it will help you.

TelephonyManager manager= (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
try {
    Class<?> telephonyClass = Class.forName(manager.getClass().getName());
    Class<?>[] parameter = new Class[1];
    parameter[0] = int.class;
    Method getFirstMethod = telephonyClass.getMethod("getDeviceId", parameter);
    Log.d("SimData", getFirstMethod.toString());
    Object[] obParameter = new Object[1];
    obParameter[0] = 0;
    String first = (String) getFirstMethod.invoke(manager, obParameter);
    Log.d("IMEI ", "first :" + first);
    obParameter[0] = 1;
    String second = (String) getFirstMethod.invoke(manager, obParameter);
    Log.d("IMEI ", "Second :" + second);
} catch (Exception e) {
    e.printStackTrace();
}

And add the permission on menifest.

<uses-permission android:name="android.permission.READ_PHONE_STATE"/>  
chandan kumar
  • 191
  • 1
  • 15