S S.M.R Member Aug 8, 2021 #1 Hello in android 11 we cant get iccid and os block request. i found link below that say solved this problem by below code can help me that how can i use this code in B4A : [CODE lang="java" title="Java Code for get icc id in android 11"]TelecomManager tm2= (TelecomManager)getSystemService(Context.TELECOM_SERVICE); Iterator<PhoneAccountHandle> phoneAccounts = tm2.getCallCapablePhoneAccounts().listIterator(); PhoneAccountHandle phoneAccountHandle = phoneAccounts.next(); return phoneAccountHandle.getId().substring(0,19);[/CODE] link : https://stackoverflow.com/questions/67905747/problems-with-android-11-and-icc
Hello in android 11 we cant get iccid and os block request. i found link below that say solved this problem by below code can help me that how can i use this code in B4A : [CODE lang="java" title="Java Code for get icc id in android 11"]TelecomManager tm2= (TelecomManager)getSystemService(Context.TELECOM_SERVICE); Iterator<PhoneAccountHandle> phoneAccounts = tm2.getCallCapablePhoneAccounts().listIterator(); PhoneAccountHandle phoneAccountHandle = phoneAccounts.next(); return phoneAccountHandle.getId().substring(0,19);[/CODE] link : https://stackoverflow.com/questions/67905747/problems-with-android-11-and-icc
Erel B4X founder Staff member Licensed User Longtime User Aug 8, 2021 #2 Handle the READ_PHONE_STATE permission (manifest editor + runtime permission) and start with this code: Code: 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) Upvote 0
Handle the READ_PHONE_STATE permission (manifest editor + runtime permission) and start with this code: Code: 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)
S S.M.R Member Aug 8, 2021 #3 Erel said: Handle the READ_PHONE_STATE permission (manifest editor + runtime permission) and start with this code: Code: 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) Click to expand... i do but dont return iccid can you help me for get iccid in android 11? please help simple thanks Upvote 0
Erel said: Handle the READ_PHONE_STATE permission (manifest editor + runtime permission) and start with this code: Code: 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) Click to expand... i do but dont return iccid can you help me for get iccid in android 11? please help simple thanks
Erel B4X founder Staff member Licensed User Longtime User Aug 8, 2021 #4 What is the output of this code? Upvote 0
S S.M.R Member Aug 8, 2021 #5 Erel said: What is the output of this code? Click to expand... output : (ArrayList) [ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, ***, UserHandle{0}, ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, ***, UserHandle{0}] i need iccid that i can found every call item from what sim by check with subscription_id field in "content://call_log/calls" subscription_id field in "content://call_log/calls" = iccid Upvote 0
Erel said: What is the output of this code? Click to expand... output : (ArrayList) [ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, ***, UserHandle{0}, ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, ***, UserHandle{0}] i need iccid that i can found every call item from what sim by check with subscription_id field in "content://call_log/calls" subscription_id field in "content://call_log/calls" = iccid
Erel B4X founder Staff member Licensed User Longtime User Aug 8, 2021 #6 Add this: Code: For Each Account As JavaObject In PhoneAccounts Log(Account.RunMethod("getId", Null)) Next Upvote 0
Add this: Code: For Each Account As JavaObject In PhoneAccounts Log(Account.RunMethod("getId", Null)) Next
S S.M.R Member Aug 9, 2021 #7 Erel said: Add this: Code: For Each Account As JavaObject In PhoneAccounts Log(Account.RunMethod("getId", Null)) Next Click to expand... Thank you so much Erel ? it work perfect? i get iccid but i dont know every iccid for what sim card? how can i found it? and please say What other information can I get besides "getId" like SIM card operator name &... thanks alot Upvote 0
Erel said: Add this: Code: For Each Account As JavaObject In PhoneAccounts Log(Account.RunMethod("getId", Null)) Next Click to expand... Thank you so much Erel ? it work perfect? i get iccid but i dont know every iccid for what sim card? how can i found it? and please say What other information can I get besides "getId" like SIM card operator name &... thanks alot
Erel B4X founder Staff member Licensed User Longtime User Aug 9, 2021 #8 API is documented here: https://developer.android.com/reference/android/telecom/PhoneAccountHandle Upvote 0