Dim rp5 As RuntimePermissions
rp5.CheckAndRequest(rp5.PERMISSION_READ_PHONE_STATE)
wait for Activity_PermissionResult(permission As String, result As Boolean)
If result=True Then
Log("ReadPHst")
Dim ph As PhoneId
Log(ph.GetDeviceId)
Log(ph.GetSubscriberId)
Else
End If
AddPermission(android.permission.READ_PHONE_STATE)
ReadPHst
main$ResumableSub_Activity_Createresume (java line: 1646)
java.lang.SecurityException: getDeviceId: The user 10628 does not meet the requirements to access device identifiers.
at android.os.Parcel.createExceptionOrNull(Parcel.java:2438)
at android.os.Parcel.createException(Parcel.java:2422)
at android.os.Parcel.readException(Parcel.java:2405)
at android.os.Parcel.readException(Parcel.java:2347)
at com.android.internal.telephony.ITelephony$Stub$Proxy.getDeviceIdWithFeature(ITelephony.java:12085)
at android.telephony.TelephonyManager.getDeviceId(TelephonyManager.java:2514)
at anywheresoftware.b4a.phone.Phone$PhoneId.GetDeviceId(Phone.java:479)
at goxc125.ap.mobile.main$ResumableSub_Activity_Create.resume(main.java:1646)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:275)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:215)
at anywheresoftware.b4a.BA$2.run(BA.java:395)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
ST:java.lang.SecurityException: getDeviceId: The user 10628 does not meet the requirements to access device identifiers.
at android.os.Parcel.createExceptionOrNull(Parcel.java:2438)
at android.os.Parcel.createException(Parcel.java:2422)
at android.os.Parcel.readException(Parcel.java:2405)
at android.os.Parcel.readException(Parcel.java:2347)
at com.android.internal.telephony.ITelephony$Stub$Proxy.getDeviceIdWithFeature(ITelephony.java:12085)
at android.telephony.TelephonyManager.getDeviceId(TelephonyManager.java:2514)
at anywheresoftware.b4a.phone.Phone$PhoneId.GetDeviceId(Phone.java:479)
at goxc125.ap.mobile.main$ResumableSub_Activity_Create.resume(main.java:1646)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:275)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:215)
at anywheresoftware.b4a.BA$2.run(BA.java:395)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
Google play is available and advertising id (with SDK 33) is not OK, I get: 000000000000000000000Advertising id should work if Google Play is available. There is no other unique id.
Wait For (GetAdvertisingId) Complete (Id As String)
if i may,Google play is available and advertising id (with SDK 33) is not OK, I get: 000000000000000000000
B4X:Wait For (GetAdvertisingId) Complete (Id As String)
with SDK 30 is the number OK.
Best regards
p4ppc
Dim DEviceID As String=""
Dim p As Phone
Try
DEviceID = P.GetSettings("android_id").ToUpperCase
Log($"DeviceID: ${DEviceID}"$)
Catch
Log(LastException)
DEviceID = ""
End Try
Log(DEviceID)
Return DeviceID
In short, it means that Google is imposing more and more restrictions on a unique ID for privacy reasons. The fewer restrictions, the greater the chance that the ID will be used to track user activity.please for advice,
I think this question is not first here, but I can not find similar question,
please for advice how to get unique number of smartphone if I am using sdk 33 with B4A?