How can I get both IMEI numbers from dual SIM mobile? Can anyone help me to resolve this problem.
How can I get both IMEI numbers from dual SIM mobile?
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_Identity –
Teratology
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-android –
Teratology
@Marek R... Now i updated the question with screen shot. –
Pierson
Here is complete solution for what you are looking for –
Zurn
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
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.
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"/>
© 2022 - 2024 — McMap. All rights reserved.