How can I get both IMEI numbers from dual SIM mobile?
Asked Answered
P

2

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

Pierson answered 9/8, 2012 at 9:58 Comment(6)
IMEI is defined for a device not for a SIM card! So your question has no sense. See wiki: en.wikipedia.org/wiki/International_Mobile_Equipment_IdentityTeratology
Once can you please check dual sim mobile. Each sim slot has a unique IMEI number. I checked just now.Pierson
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. https://mcmap.net/q/88844/-dual-sim-card-androidTeratology
@Marek R... Now i updated the question with screen shot.Pierson
Here is complete solution for what you are looking forZurn
You can get 2 different IMEIs in case of Dual SIM devices. Refer this answer by Pied Piper to get 2 different IMEIs for dual SIM phones.Cableway
S
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.

Sapele answered 21/12, 2012 at 6:17 Comment(0)
A
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"/>  
Alvy answered 1/3, 2017 at 7:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.