I want to read which sim card allocated for default voice call in sim management settings programmatically .Is that possible? I have tried to open setting provider by intent but I cant able read the sim slots allocated for calls
Asked
Active
Viewed 3,208 times
2 Answers
0
I dont think its possible. But hey, if you want to know which sim was used for making call, you can get it from call logs database. There is a column for sim slots in the table.

Imdad
- 683
- 1
- 9
- 27
-
Ya that is there to know details of sim but I want to know exact sim which is set for calling.Is it possible to capture details of sim before calling? – jerry Jun 21 '16 at 05:58
-
I don't think so. Also, it seems irrelevant. I have a motoX play and I get two call buttons labelled as 1 & 2 in the dialer corresponding to sim slots. So, there is no need for any defaults. I get to choose every time I make a call. – Imdad Jun 21 '16 at 06:08
-
When I press button it should show the default voice call settings alert box .Within my activity I want to show that alert box.Is that possible – jerry Jun 22 '16 at 06:22
-
I am not sure if I understood your question but if you are asking about the prompt for selecting SIM, you can try this - http://stackoverflow.com/a/21426015/3260244 . In the given code, just replace ACTION_CALL with ACTION_DIAL . Let me know how it fares! – Imdad Jun 22 '16 at 10:09
-
Thank you so much I tried ,working fine .This what I needed – jerry Jun 22 '16 at 10:53
-
If it worked then accept the answer and upvote so that others can also get help from this. – Imdad Jun 23 '16 at 07:08
0
This isn't a definite answer, I'm also looking for this function. But I managed to find a solution which works partially. You can use the TelephonyManager to obtain the preferred SIM.
TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
String activeSIMNetwork = tm.getNetworkOperator();
The catch here, is that this preference is not sometimes valid. If you change from one sim to another and check, it will give you the correct preferred SIM set in the phone. But if you reboot the phone and check, it will not give you the correctly displayed preference.
I will post an update if I get it to work in some other way.

Tharaka Devinda
- 1,952
- 21
- 23