Android : Check whether the phone is dual SIM
Asked Answered
R

9

116

After a lot of research on forums, now I know that there is no way to find IMSI or SIM serial number for both the SIM cards in a dual SIM phone (except for contacting the manufacturer). Now my changed question is, can we at all detect that the phone has two SIMs? I believe it can be detected with some intelligence. Few ways I can think of are:

  1. Dialing an USSD code and tracing the logs for IMEI number (I tried this with *139# in India. It worked.) This will give me IMEI number for the SIM from which I dialed the USSD code. (It is presumed that the phone follows android guidelines and has two IMEI numbers.)

  2. Storing the SIM serial number and/or IMSI for the SIM. And after detection of any other IMSI/Serial number even if the phone was not rebooted (i.e. the SIM was switched) by tracing some logs or by some broadcast event handling.

  3. By dialing *06# you will get to see both IMEI numbers. By some way, get those two numbers. (Something like screen capturing and image parsing for text.)

If anyone can think of some other ways, they are most welcome. I would really appreciate any kind of help regarding this. Also, if anyone has any information about any manufacturers APIs or links to contact them, please do share with the community people.

Revest answered 25/1, 2013 at 7:31 Comment(8)
Hi Rajkiran, Finally i got the solution its working fine for me. Hope it should helpful for everyone who wants to handle Duel SIM in mobile applications. The duel SIM handle API is not documented. Please check my answer its working fine for me. #17619151Interpretative
Thanks.. but your answer does not answer my question. I want all the details about the second SIM and IMEI. @Pied Piper's answer helps me get everything.Revest
@Revest Pied Piper's answer really helped you? I have checked his code in m samsung galaxy y duos but its not working.Did you help me to find IMEI nos of dual sim phone?Nadiya
@nitishpatel : Yes definately it helped. Unfortunately I do not have Y Duos to check. But I believe Samsung uses different mechanism for dual SIM handling on android version 4.0 onwards. Pied Pipers answer helps in 4.0 onwards devices. For the rest, you'll need to dig a bit more using reflection.Revest
Hi, I find a Solution...please check code https://mcmap.net/q/88840/-programmatically-retrieve-imei-number-for-dual-sim-in-android It is tested on various phoneSemicircle
any solution with cordova?Flaunty
@Flaunty I don't think I know much about Cordova but can't you write a method which will call Android Native code?Revest
You can try use MultiSim library: https://mcmap.net/q/88841/-android-dual-sim-card-apiParentage
J
189

Update 23 March'15 :

Official multiple SIM API is available now from Android 5.1 onwards

Other possible option :

You can use Java reflection to get both IMEI numbers.

Using these IMEI numbers you can check whether the phone is a DUAL SIM or not.

Try following activity :

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        TelephonyInfo telephonyInfo = TelephonyInfo.getInstance(this);

        String imeiSIM1 = telephonyInfo.getImsiSIM1();
        String imeiSIM2 = telephonyInfo.getImsiSIM2();

        boolean isSIM1Ready = telephonyInfo.isSIM1Ready();
        boolean isSIM2Ready = telephonyInfo.isSIM2Ready();

        boolean isDualSIM = telephonyInfo.isDualSIM();

        TextView tv = (TextView) findViewById(R.id.tv);
        tv.setText(" IME1 : " + imeiSIM1 + "\n" +
                " IME2 : " + imeiSIM2 + "\n" +
                " IS DUAL SIM : " + isDualSIM + "\n" +
                " IS SIM1 READY : " + isSIM1Ready + "\n" +
                " IS SIM2 READY : " + isSIM2Ready + "\n");
    }
}

And here is TelephonyInfo.java :

import java.lang.reflect.Method;

import android.content.Context;
import android.telephony.TelephonyManager;

public final class TelephonyInfo {

    private static TelephonyInfo telephonyInfo;
    private String imeiSIM1;
    private String imeiSIM2;
    private boolean isSIM1Ready;
    private boolean isSIM2Ready;

    public String getImsiSIM1() {
        return imeiSIM1;
    }

    /*public static void setImsiSIM1(String imeiSIM1) {
        TelephonyInfo.imeiSIM1 = imeiSIM1;
    }*/

    public String getImsiSIM2() {
        return imeiSIM2;
    }

    /*public static void setImsiSIM2(String imeiSIM2) {
        TelephonyInfo.imeiSIM2 = imeiSIM2;
    }*/

    public boolean isSIM1Ready() {
        return isSIM1Ready;
    }

    /*public static void setSIM1Ready(boolean isSIM1Ready) {
        TelephonyInfo.isSIM1Ready = isSIM1Ready;
    }*/

    public boolean isSIM2Ready() {
        return isSIM2Ready;
    }

    /*public static void setSIM2Ready(boolean isSIM2Ready) {
        TelephonyInfo.isSIM2Ready = isSIM2Ready;
    }*/

    public boolean isDualSIM() {
        return imeiSIM2 != null;
    }

    private TelephonyInfo() {
    }

    public static TelephonyInfo getInstance(Context context){

        if(telephonyInfo == null) {

            telephonyInfo = new TelephonyInfo();

            TelephonyManager telephonyManager = ((TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE));

            telephonyInfo.imeiSIM1 = telephonyManager.getDeviceId();;
            telephonyInfo.imeiSIM2 = null;

            try {
                telephonyInfo.imeiSIM1 = getDeviceIdBySlot(context, "getDeviceIdGemini", 0);
                telephonyInfo.imeiSIM2 = getDeviceIdBySlot(context, "getDeviceIdGemini", 1);
            } catch (GeminiMethodNotFoundException e) {
                e.printStackTrace();

                try {
                    telephonyInfo.imeiSIM1 = getDeviceIdBySlot(context, "getDeviceId", 0);
                    telephonyInfo.imeiSIM2 = getDeviceIdBySlot(context, "getDeviceId", 1);
                } catch (GeminiMethodNotFoundException e1) {
                    //Call here for next manufacturer's predicted method name if you wish
                    e1.printStackTrace();
                }
            }

            telephonyInfo.isSIM1Ready = telephonyManager.getSimState() == TelephonyManager.SIM_STATE_READY;
            telephonyInfo.isSIM2Ready = false;

            try {
                telephonyInfo.isSIM1Ready = getSIMStateBySlot(context, "getSimStateGemini", 0);
                telephonyInfo.isSIM2Ready = getSIMStateBySlot(context, "getSimStateGemini", 1);
            } catch (GeminiMethodNotFoundException e) {

                e.printStackTrace();

                try {
                    telephonyInfo.isSIM1Ready = getSIMStateBySlot(context, "getSimState", 0);
                    telephonyInfo.isSIM2Ready = getSIMStateBySlot(context, "getSimState", 1);
                } catch (GeminiMethodNotFoundException e1) {
                    //Call here for next manufacturer's predicted method name if you wish
                    e1.printStackTrace();
                }
            }
        }

        return telephonyInfo;
    }

    private static String getDeviceIdBySlot(Context context, String predictedMethodName, int slotID) throws GeminiMethodNotFoundException {

        String imei = null;

        TelephonyManager telephony = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);

        try{

            Class<?> telephonyClass = Class.forName(telephony.getClass().getName());

            Class<?>[] parameter = new Class[1];
            parameter[0] = int.class;
            Method getSimID = telephonyClass.getMethod(predictedMethodName, parameter);

            Object[] obParameter = new Object[1];
            obParameter[0] = slotID;
            Object ob_phone = getSimID.invoke(telephony, obParameter);

            if(ob_phone != null){
                imei = ob_phone.toString();

            }
        } catch (Exception e) {
            e.printStackTrace();
            throw new GeminiMethodNotFoundException(predictedMethodName);
        }

        return imei;
    }

    private static  boolean getSIMStateBySlot(Context context, String predictedMethodName, int slotID) throws GeminiMethodNotFoundException {

        boolean isReady = false;

        TelephonyManager telephony = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);

        try{

            Class<?> telephonyClass = Class.forName(telephony.getClass().getName());

            Class<?>[] parameter = new Class[1];
            parameter[0] = int.class;
            Method getSimStateGemini = telephonyClass.getMethod(predictedMethodName, parameter);

            Object[] obParameter = new Object[1];
            obParameter[0] = slotID;
            Object ob_phone = getSimStateGemini.invoke(telephony, obParameter);

            if(ob_phone != null){
                int simState = Integer.parseInt(ob_phone.toString());
                if(simState == TelephonyManager.SIM_STATE_READY){
                    isReady = true;
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
            throw new GeminiMethodNotFoundException(predictedMethodName);
        }

        return isReady;
    }


    private static class GeminiMethodNotFoundException extends Exception {

        private static final long serialVersionUID = -996812356902545308L;

        public GeminiMethodNotFoundException(String info) {
            super(info);
        }
    }
}

Edit :

Getting access of methods like "getDeviceIdGemini" for other SIM slot's detail has prediction that method exist.

If that method's name doesn't match with one given by device manufacturer than it will not work. You have to find corresponding method name for those devices.

Finding method names for other manufacturers can be done using Java reflection as follows :

public static void printTelephonyManagerMethodNamesForThisDevice(Context context) {

    TelephonyManager telephony = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
    Class<?> telephonyClass;
    try {
        telephonyClass = Class.forName(telephony.getClass().getName());
        Method[] methods = telephonyClass.getMethods();
        for (int idx = 0; idx < methods.length; idx++) {

            System.out.println("\n" + methods[idx] + " declared by " + methods[idx].getDeclaringClass());
        }
    } catch (ClassNotFoundException e) {
        e.printStackTrace();
    }
} 

EDIT :

As Seetha pointed out in her comment :

telephonyInfo.imeiSIM1 = getDeviceIdBySlot(context, "getDeviceIdDs", 0);
telephonyInfo.imeiSIM2 = getDeviceIdBySlot(context, "getDeviceIdDs", 1); 

It is working for her. She was successful in getting two IMEI numbers for both the SIM in Samsung Duos device.

Add <uses-permission android:name="android.permission.READ_PHONE_STATE" />

EDIT 2 :

The method used for retrieving data is for Lenovo A319 and other phones by that manufacture (Credit Maher Abuthraa):

telephonyInfo.imeiSIM1 = getDeviceIdBySlot(context, "getSimSerialNumberGemini", 0); 
telephonyInfo.imeiSIM2 = getDeviceIdBySlot(context, "getSimSerialNumberGemini", 1); 
Jibe answered 6/7, 2013 at 5:9 Comment(34)
Cool! That worked for me with "getDeviceId" on Karbonn. Will search for Samsung methods and will update here when I have it with me. Thanks man. Kudos.Revest
I was successful in getting IMSI numbers for both the SIM cards on Karbonn phones. I tried a lot to get 2 IMEI numbers or SIM info for both the SIMs for Samsung. But somehow I couldn't. Can you please check on Samsung dual SIM phones and let us know? If possible please contact me through my profile.Revest
Unfortunately I didn't found any direct straight forward declared method to get second IMEI by printing list of telephony class methods in Samsung devices so I am also finding any clue for other way. If I will get that I'll surely update here.Jibe
Yes. Even I did that. Found that Samsung uses com.android.internal.telephony.RILConstants$SimCardID internally. Even tried creating that class with the same signature of methods and same names of variables. But no luck. Will try getting source code and will try to check. Thanks.Revest
Can you tell me please, is it possible to disable 1 of 2 SIM cards or turn on airplane mode for it, using this methods or/and information, that is got using them?Bortman
In edit section of answer I posted method that display all method names of telephony class, you can find your useful method if any.Jibe
@Pied Piper I used getLine1Number to get user mobile number and match with user entered no for mobile number verification .But when i used dual sim mobile for testing. my application was crashed .I check your code but in that you did not specified how to get dual sim mobile's both sim's no..Thanks in advanceFollmer
@MahiSingh In edit section of answer I posted method that prints all method names of telephony class for particular device, from which you can find methods that give you any required SIM card info then you reflect it as we did for IMEI.Jibe
Are u succeeded with Samsung dual Sim details. Please share. ThanksAnticyclone
I use telephonyInfo.imeiSIM1 = getDeviceIdBySlot(context, "getDeviceIdDs", 0);telephonyInfo.imeiSIM2 = getDeviceIdBySlot(context, "getDeviceIdDs", 1); It is working for me. I was successful in getting two IMEI numbers for both the SIM.Underbrush
@Underbrush Great. For which device?Jibe
Unable to calculate signal strength of the other SIM, because no method is available of listen() is available which accepts slotID. Which is there for other methods such as getDeviceId(int). Please help.Disloyal
@Disloyal See list of methods for devices and find out useful method to be invoked is only solution.Jibe
How can I get Phone number of SIM2? I am getting SIM1 number using telephony.getLine1Number() method, in the list of method I cant find method like getLine2Number() or getLine1Number(int)Laflam
See list of methods for devices and find out useful method to be invoked is only solutionJibe
The method used for retrieving data is for Lenovo A319 and other phones by that manufacture: telephonyInfo.imsiSIM1 = getDeviceIdBySlot(context, "getSimSerialNumberGemini", 0); telephonyInfo.imsiSIM2 = getDeviceIdBySlot(context, "getSimSerialNumberGemini", 1); please to update your answer.. thanks btw :-)Capitulum
sorry Vaibhav, the methods I did provided are for serialNumber not IMSI.. I couldn't get IMSIs for dual device by this way .. i made it with this way : https://mcmap.net/q/88842/-get-imsi-from-the-sim-using-codename1Capitulum
deviceId is IMEI not IMSI, isn't it?Tipton
@Underbrush Can you tell me method name for getSubscriberId ?Tipton
@Laflam have you found something to get the phone number from dual sim phone for both SIMsArkansas
Can you plz help me to get operator name in dual simCoxa
what i can do for sending message from specific sim?Wheresoever
add this please for samsung sim state change: "getSimStateDs", this seem not any additional names for this two methods, I found these info on this forum, more than 200+ phone print their information: 4pda.ru/forum/lofiversion/index.php?t632334.htmlGoodwill
any solution with cordova?Flaunty
Hi, the two java classes exposed works fine on HONOR7 DUAL SIM (HUWAEI).Sheffie
how to get phone number ?Tman
Can above solution tell the carrier/operator name of both sims?Facer
The above code is working fine..i have two sim, one is active, another sim is waiting for customer care activation, but, second sim also showing Simready true only(2nd sim tower not shown, still, waiting for New Sim Activation).. can anyone tell how to detect this scenario state ?Ringtail
How is it possible to get second sim cards phone number?Stableboy
telephonyInfo.imsiSIM1 = telephonyManager.getDeviceId(); This is wrong here, getDeviceId() will return IMEI, not IMSI. IMEI and IMSI they are totally different. Please don't mislead other people.Hectocotylus
@User9527 corrected :) Initially I called it IMEI but someone miss guided me about it. Anyway it can determine whether phone is dual SIM or not :)Jibe
telephonyManager.getDeviceId() when targeting Android > M, there will be an error: Call requires permission which may be rejected by user: code should explicitly check to see if permission is available (with checkPermission) or explicitly handle a potential SecurityExceptionCarve
I want to get the SIM SERIAL NUMBER for DUAL SIM devices, not the IMEI number for the devices targetting API < 22. I am getting the SIM SERIAL NUMBER for devices targetting API >= 22 with the help of SubscriptionManager added in API 22. i want for API < 22. dual SIM, single SIM i am getting with the help of telephonymanager.Diencephalon
It seems there is also source code on github github.com/ITger/DualSIMCardHerwig
E
6

I have a Samsung Duos device with Android 4.4.4 and the method suggested by Seetha in the accepted answer (i.e. call getDeviceIdDs) does not work for me, as the method does not exist. I was able to recover all the information I needed by calling method "getDefault(int slotID)", as shown below:

public static void samsungTwoSims(Context context) {
    TelephonyManager telephony = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);

    try{

        Class<?> telephonyClass = Class.forName(telephony.getClass().getName());

        Class<?>[] parameter = new Class[1];
        parameter[0] = int.class;
        Method getFirstMethod = telephonyClass.getMethod("getDefault", parameter);

        Log.d(TAG, getFirstMethod.toString());

        Object[] obParameter = new Object[1];
        obParameter[0] = 0;
        TelephonyManager first = (TelephonyManager) getFirstMethod.invoke(null, obParameter);

        Log.d(TAG, "Device Id: " + first.getDeviceId() + ", device status: " + first.getSimState() + ", operator: " + first.getNetworkOperator() + "/" + first.getNetworkOperatorName());

        obParameter[0] = 1;
        TelephonyManager second = (TelephonyManager) getFirstMethod.invoke(null, obParameter);

        Log.d(TAG, "Device Id: " + second.getDeviceId() + ", device status: " + second.getSimState()+ ", operator: " + second.getNetworkOperator() + "/" + second.getNetworkOperatorName());
    } catch (Exception e) {
        e.printStackTrace();
    }   
}

Also, I rewrote the code that iteratively tests for methods to recover this information so that it uses an array of method names instead of a sequence of try/catch. For instance, to determine if we have two active SIMs we could do:

private static String[] simStatusMethodNames = {"getSimStateGemini", "getSimState"};


public static boolean hasTwoActiveSims(Context context) {
    boolean first = false, second = false;

    for (String methodName: simStatusMethodNames) {
        // try with sim 0 first
        try {
            first = getSIMStateBySlot(context, methodName, 0);
            // no exception thrown, means method exists
            second = getSIMStateBySlot(context, methodName, 1);
           return first && second;
        } catch (GeminiMethodNotFoundException e) {
            // method does not exist, nothing to do but test the next
        }
    }
    return false;
}

This way, if a new method name is suggested for some device, you can simply add it to the array and it should work.

Exocrine answered 16/9, 2015 at 18:35 Comment(0)
S
6

There are several native solutions I've found while searching the way to check network operator.

For API >=17:

TelephonyManager manager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);

// Get information about all radio modules on device board
// and check what you need by calling #getCellIdentity.

final List<CellInfo> allCellInfo = manager.getAllCellInfo();
for (CellInfo cellInfo : allCellInfo) {
    if (cellInfo instanceof CellInfoGsm) {
        CellIdentityGsm cellIdentity = ((CellInfoGsm) cellInfo).getCellIdentity();
        //TODO Use cellIdentity to check MCC/MNC code, for instance.
    } else if (cellInfo instanceof CellInfoWcdma) {
        CellIdentityWcdma cellIdentity = ((CellInfoWcdma) cellInfo).getCellIdentity();
    } else if (cellInfo instanceof CellInfoLte) {
        CellIdentityLte cellIdentity = ((CellInfoLte) cellInfo).getCellIdentity();
    } else if (cellInfo instanceof CellInfoCdma) {
        CellIdentityCdma cellIdentity = ((CellInfoCdma) cellInfo).getCellIdentity();
    } 
}

In AndroidManifest add permission:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
</manifest>

To get network operator you can check mcc and mnc codes:

For API >=22:

final SubscriptionManager subscriptionManager = SubscriptionManager.from(context);
final List<SubscriptionInfo> activeSubscriptionInfoList = subscriptionManager.getActiveSubscriptionInfoList();
for (SubscriptionInfo subscriptionInfo : activeSubscriptionInfoList) {
    final CharSequence carrierName = subscriptionInfo.getCarrierName();
    final CharSequence displayName = subscriptionInfo.getDisplayName();
    final int mcc = subscriptionInfo.getMcc();
    final int mnc = subscriptionInfo.getMnc();
    final String subscriptionInfoNumber = subscriptionInfo.getNumber();
}

For API >=23. To just check if phone is dual/triple/many sim:

TelephonyManager manager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
if (manager.getPhoneCount() == 2) {
    // Dual sim
}
Scorpion answered 5/11, 2016 at 15:4 Comment(0)
A
5

I am able to read both the IMEI's from OnePlus 2 Phone

 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                TelephonyManager manager = (TelephonyManager) getActivity().getSystemService(Context.TELEPHONY_SERVICE);
                Log.i(TAG, "Single or Dual Sim " + manager.getPhoneCount());
                Log.i(TAG, "Default device ID " + manager.getDeviceId());
                Log.i(TAG, "Single 1 " + manager.getDeviceId(0));
                Log.i(TAG, "Single 2 " + manager.getDeviceId(1));
            }
Aorta answered 10/8, 2016 at 11:57 Comment(3)
Good that it works on One Plus. But request you to post answers which works for all phones and all android versions (probably)Revest
This is an official SDK. Should work for all phone. I have tested it on OnePlus 2Aorta
So the accepted answer from @Swapnil tells the same thing right?Revest
S
2

I was taking a look at the call logs and I noticed that apart from the usual fields in the contents of managedCursor, we have a column "simid" in Dual SIM phones (I checked on Xolo A500s Lite), so as to tag each call in the call log with a SIM. This value is either 1 or 2, most probably denoting SIM1/SIM2.

managedCursor = context.getContentResolver().query(contacts, null, null, null, null);
managedCursor.moveToNext();        
for(int i=0;i<managedCursor.getColumnCount();i++)
{//for dual sim phones
    if(managedCursor.getColumnName(i).toLowerCase().equals("simid"))
        indexSIMID=i;
}

I did not find this column in a single SIM phone (I checked on Xperia L).

So although I don't think this is a foolproof way to check for dual SIM nature, I am posting it here because it could be useful to someone.

Stereotypy answered 7/1, 2015 at 20:21 Comment(1)
You are reading a DB, which one? Please clarify what you are doing here. (Where is the "contacts" db stored?Pooler
D
1

Tips:

You can try to use

ctx.getSystemService("phone_msim")

instead of

ctx.getSystemService(Context.TELEPHONY_SERVICE)

If you have already tried Vaibhav's answer and telephony.getClass().getMethod() fails, above is what works for my Qualcomm mobile.

Domesticate answered 30/5, 2014 at 4:40 Comment(2)
As long as the answer is complete you may post links to web pages in other languages for supplementary information. meta.#271560Roa
That was actually a useful link, no need to remove it.Pooler
M
1

I have found these system properties on Samsung S8

SystemProperties.getInt("ro.multisim.simslotcount", 1) > 1

Also, according to the source: https://android.googlesource.com/platform/frameworks/base/+/master/telephony/java/com/android/internal/telephony/TelephonyProperties.java

getprop persist.radio.multisim.config returns "dsds" or "dsda" on multi sim.

I have tested this on Samsung S8 and it works

Muddler answered 25/5, 2017 at 5:48 Comment(1)
Never mind. Android already has APIs for dual SIM now. developer.android.com/about/versions/android-5.1.html#multisim For everything else, you can refer to above answer by @vaibhavRevest
Q
0

for sdk api 26+ (Build.VERSION_CODES.O):

val telephony = context.getSystemService(Service.TELEPHONY_SERVICE) as? TelephonyManager
// check telephony on null
val simCount = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
   telephony.activeModemCount
} else {
   telephony.phoneCount
}
Quaff answered 11/5, 2022 at 13:50 Comment(0)
M
-2

Commonsware says this is not possible. Please see the following:

Detecting Dual SIM using Android SDK is not possible.

Here is further dialog on the subject:

Google dev team guy says detecting Dual SIM using Android SDK is not possible.

Measurable answered 25/4, 2013 at 22:46 Comment(9)
Yes man. I know that. But that's why I am trying to find a workaround. And there has to be some. Try USSDDualWidget app from Play Store. It can actually switch between the two SIMs. Even tried to reverse engineer the code, but no luck.Revest
Does it work on all devices or just a limited subset that expose some sort of proprietary interface?Measurable
That seems to work on Samsung dual SIM phones, at least. Unfortunately, I could check only on Samsung Galaxy Y Duos and Galaxy Grand.Revest
My guess is there is some manufacturer-specific API that allows for this. I didn't even know Samsung made dual-SIM phones!Measurable
There may be no universal method for working with different sims (slots), but sometimes you can get information about a particular sim using TelephonyManager's methods ending with Gemini. E. g. String getLine1NumberGemini(int slotId), where slotId is the sequential number of the sim card (0, 1). These methods can be invoked via reflection only.Disputable
Yes, actually I was able to use Java reflection as well for my particular case. But the code varies on a phone-by-phone basis as there is no universal way to do this.Measurable
Manytimes commonsware has said its not possible which has been made possible by other developers. So, its not like that what commonsware says is always right :-)Tripping
You may be correct, but I do think he is a fairly credible resource for all things Android. As for this particular issue, sure, I did the same thing and used reflection to obtain dual sim data, but it was for my particular device. To this day, I still don't believe there is any generic way to go about doing this. Also notice I quoted a Google developer as well and not just Commonsware.Measurable
He has updated his answer , its time you update your answer tooSmoulder

© 2022 - 2024 — McMap. All rights reserved.