Android Question How do I know the numbers of two SIM in mobile

alfaiz678

Well-Known Member
Licensed User
Which version of Android?

6.0.1

What happens when you try to get it with SimCard library?

LT
LT C1300
C1300
1: - DATA_ACTIVITY_NONE
2: - DATA_DISCONNECTED
3: - A100005C57873A
4: - 865792030324848
5: - Android-Mms/2.0
6: - http://www.google.com/oha/rdf/ua-profile-kila.xml
7: - ye
8: - 42103
9: - PHONE_TYPE_CDMA

code
B4X:
Log("1: - " & sim.GetDataActivity)
    Log("2: - " & sim.GetDataState)
    Log("3: - " & sim.GetLine1Number)
    Log("4: - " & sim.GetLine2Number)
    Log("5: - " & sim.GetMmsAgent)
    Log("6: - " & sim.GetMmsURL)
    Log("7: - " & sim.GetNetworkCountryIso)
    Log("8: - " & sim.GetNetworkOperator)
    Log("9: - " & sim.GetPhoneType)
 
Last edited:
Upvote 0

alfaiz678

Well-Known Member
Licensed User
this result

(SubscriptionInfo) {id=3, iccId=899679162XXXXXXXXXXX simSlotIndex=0 displayName=Yemen Mobile carrierName=42103 nameSource=0 iconTint=-16746133 dataRoaming=1 iconBitmap=android.graphics.Bitmap@7b78752 mcc 421 mnc 3}

(SubscriptionInfo) {id=1, iccId=899670620XXXXXXXXXXX simSlotIndex=1 displayName=SabaFon carrierName=SabaFon nameSource=2 iconTint=-16746133 dataRoaming=0 iconBitmap=android.graphics.Bitmap@fcbca23 mcc 421 mnc 1}



Other codes were also used
Such as
B4X:
    Dim pId As PhoneId
    Log( pId.GetLine1Number )

and
B4X:
Log(info.RunMethod("getDisplayName", Null))
        Log(info.RunMethod("getNumber", Null))
and
B4X:
Dim ctxt As JavaObject
   ctxt.InitializeContext
   Dim telecom As JavaObject = ctxt.RunMethod("getSystemService", Array("telecom"))
   Dim accounts As List = telecom.RunMethod("getCallCapablePhoneAccounts", Null)
   Log(accounts)

The same result phone numbers do not appear
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
What is the output of:
B4X:
Dim p As PhoneId 'ignore, required for the permission
Dim ctxt As JavaObject
ctxt.InitializeContext
Dim SubscriptionManager As JavaObject = ctxt.RunMethod("getSystemService", Array("telephony_subscription_service"))
Dim infolist As List = SubscriptionManager.RunMethod("getActiveSubscriptionInfoList", Null)
For Each info As JavaObject In infolist
   Log("Number: " & info.RunMethod("getNumber", Null))
Next
 
Upvote 0

alfaiz678

Well-Known Member
Licensed User


Number: null
Number: null
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…