Android dual SIM signal strength
For this particular version of TelephonyManager, instead of using
TelephonyManager.listen (phoneStateListener, state)
which only listens on the default SIM, you may try using 2 instances of your PhoneStateListener, and call
TelephonyManager.listenGemini (phoneStateListener1, state, 0)
for the 1st SIM, and
TelephonyManager.listenGemini (phoneStateListener2, state, 1)
for the 2nd SIM,
where the third parameter for listenGemini
is the SIM number.
Thanks for the answer headuck! I have not tried your solution, but i found my own solution which worked.
It is possible to use a different constructor for the TelephonyManager where you can pass in the sim card slot you want control over:
MultiSimClass = Class.forName("android.telephony.MultiSimTelephonyManager");
for (Constructor<?> constructor : MultiSimClass.getConstructors()){
if (constructor.getParameterTypes().length == 2){
try {
multiSimTelephonyManager1 = constructor.newInstance(context,0);
multiSimTelephonyManager2 = constructor.newInstance(context,1);
}
}
}