0
  1. Read sim details(Sim Number , Name) from Android call logs.

For Example : In My mobile have dual sim(SIM1,SIM2),While I Make a call using SIM1 Means, I need to get SIM1 all details after call cut.

saravanan
  • 388
  • 2
  • 18
  • it means you need to call log details. –  May 03 '18 at 11:49
  • @AndroidTeam Already i get call duration,Number, DateTime , Type etc...But i unable to get Sim Number and Serial Number while Make Call – saravanan May 03 '18 at 11:54

1 Answers1

0

I have been working on such an app that performs call tests, both from calling sim1 and sim2. the fact is when make call, you can get SIM Serial Number (IMSI) and Sim Number by following line of codes,

String IMSI = telephonyManager.getSubscriberId();

String phoneNumber =telephonyManager.getLine1Number();

note: some sim cards does not contain phone number, in that case code will return null or empty string. visit this link

  • Okay i will test now one doubt if i select sim1 its give sim1 subscriberid right?and if i select sim2 its give sim2 subscriberiid right? – saravanan May 03 '18 at 12:31
  • It will give the information (imsi and phone number) of the sim which is making call, doesn't matter whether it is sim1 or sim2. – Ikram Hussain May 03 '18 at 13:26
  • Okay its possible to get sim details while make call – saravanan May 03 '18 at 13:41
  • yes, it is possible. use telephonyManager to get sim details. – Ikram Hussain May 04 '18 at 05:37
  • If i using telephony Manager means its get default or SIM 1 Details only,If i Make call SIM2 Telephony Manager Always give SIM1 Details First after that it give SIM2 Details.If you have any sample link can you give or give some idea will check – saravanan May 04 '18 at 06:14
  • if you share your code, it will be better to understand where you are getting things wrong. – Ikram Hussain May 04 '18 at 07:57