How to determine the number of SIM cards on a device?
Asked Answered
C

3

5

Sometimes we encounter some devices which have two or more SIM cards. So my question is:

How can I determine the number of SIM cards on the device?

Actually, I am developing a field test app and for example, if I have 2 SIM cards on the device, the user can choose between them to launch measurements.

Comnenus answered 3/4, 2012 at 13:46 Comment(0)
S
6

There is currently no Android API for handling multiple SIM cards; any device support is entirely down to the handset manufacturer having modified the Android source. You could see if the particular manufacturer offers any kind of SDK or published API to help you, but it will be on a case by case basis.

Spearwort answered 3/4, 2012 at 13:56 Comment(2)
Thanks a lot for your response. I'm working for a manufacter, maybe they could help.Comnenus
If I had control of the whole thing, I would probably do it with intents; have one intent that asks the system for SIM information, and another that the system broadcasts in response which carries the result data. That way you still have an ordinary Android app that compiles normally, even though it needs the special system modifications to actually work.Spearwort
D
5

All phones that support multiple sim card switching do so outside the android SDK so you'd have to contact their manufacturers for information about how they expose this functionality.

Douzepers answered 3/4, 2012 at 13:56 Comment(0)
Y
1

The question is very outdated and probably the answer was already found. But this may help someone else. Beginning from Android API 22 you can do so via the SubscriptionManager like below:

val subManager = getSystemService(TELEPHONY_SUBSCRIPTION_SERVICE) as SubscriptionManager
val simCount = subManager.activeSubscriptionInfoCountMax //Total supported sim cards by device
val simAvailable = subManager.activeSubscriptionInfoCount // Currently active sim cards amount
Yvoneyvonne answered 11/8, 2022 at 9:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.