1

I want to get unique id for SIM (line1number or simserialnumber...) when SMS is received. It works fine for single SIM. Is it possible for multi SIM?

Quentin Hayot
  • 7,786
  • 6
  • 45
  • 62
spr
  • 322
  • 3
  • 15

2 Answers2

4

Multiple SIM support was only added to the standard Android API in Android 5.1 (Lollipop_MR1 - API Level 22) - see here. Devices earlier than that with multiple SIMs used customised versions of Android to support multiple SIMs, so there's no standard way to get the information you want as it will work differently on each device.

If you're targeting API Level 22 and above, you can use SubscriptionManager to get the information about different SIMs.

HexAndBugs
  • 5,549
  • 2
  • 27
  • 36
0

Yes, You can use the SubscriptionManager to get the subscription information.

Also note that we have a Parcelable class for Subscription Information called SubscriptionInfo that has following method relevant to you:

public int getSimSlotIndex ()
public int getSubscriptionId ()
TryinHard
  • 4,078
  • 3
  • 28
  • 54