Handle the READ_PHONE_STATE permission (manifest editor + runtime permission) and start with this code:
B4X:
Dim ctxt As JavaObject
ctxt.InitializeContext
Dim tm2 As JavaObject = ctxt.RunMethod("getSystemService", Array("telecom"))
Dim PhoneAccounts As List = tm2.RunMethod("getCallCapablePhoneAccounts", Null)
Log(PhoneAccounts)
Handle the READ_PHONE_STATE permission (manifest editor + runtime permission) and start with this code:
B4X:
Dim ctxt As JavaObject
ctxt.InitializeContext
Dim tm2 As JavaObject = ctxt.RunMethod("getSystemService", Array("telecom"))
Dim PhoneAccounts As List = tm2.RunMethod("getCallCapablePhoneAccounts", Null)
Log(PhoneAccounts)