0

I have a small App which creates call statistics for my smartphones. It reads the calllog and depending if a "simid" is present in the calllog database or not, it splits the statistics for one or two SIM cards.

This worked fine so far for all of my dual and single sim mobiles, but not for Moto G 2nd generation, which is a dual sim smartphone: the simid column is not present in the calllog.

Does anybody know how to get the SIM-ID for a call or the information which SIM card was used for a call?

1 Answers1

1

I found it myself (so for anybody who has the same problem):

the calllog has a sub_id column which holds the serial number of the SIM used for the call.

To retrieve the serial can be done by using TelephonyManager.getSimSerialNumber().

I just check if the sub_id equals to the serial of the first SIM, then the call was done with the first SIM card, otherwise with the seconds one. This works fine.