Sub TestSim
Dim manager As JavaObject
Dim context As JavaObject
context.InitializeContext
manager = manager.InitializeStatic("android.telephony.SubscriptionManager").RunMethod("from", Array(context))
Dim infos As List = manager.RunMethod("getActiveSubscriptionInfoList", Null)
For Each info As JavaObject In infos
Log(info)
'work with info
'http://developer.android.com/reference/android/telephony/SubscriptionInfo.html
Next
End Sub
I tried the code posted by Erel in this thread. It is reading both the SIM's serial numbers in the column named iccId, unfortunately only the first 9 characters are displayed, the rest are shown as XXXXXXX. It is supposed to be 19 characters.
I mean this code
B4X:
Sub TestSim
Dim manager As JavaObject
Dim context As JavaObject
context.InitializeContext
manager = manager.InitializeStatic("android.telephony.SubscriptionManager").RunMethod("from", Array(context))
Dim infos As List = manager.RunMethod("getActiveSubscriptionInfoList", Null)
For Each info As JavaObject In infos
Log(info)
'work with info
'http://developer.android.com/reference/android/telephony/SubscriptionInfo.html
Next
End Sub
I inserted the Log(info) into a list view. It is displaying 2 records, 1 for each SIM
Does it means that this will work only on Lollipop or above ?
Is there any way that this can be made working on all android versions, atleast above Android ver 4