Hello Everyone,
I am using the following procedure to get device id on customer devices... It works 95% of the time, but a few people have reported that the device id is "unknown" "blank" or "0" sometimes.
Funnily, the same people on the same devices are able to retrive the device id once they restart the app.
Has anyone else faced this issue? Any suggestions?
regards
carloz
I am using the following procedure to get device id on customer devices... It works 95% of the time, but a few people have reported that the device id is "unknown" "blank" or "0" sometimes.
Funnily, the same people on the same devices are able to retrive the device id once they restart the app.
B4X:
Sub GetDeviceId As String
Dim ph As Phone
Dim id As String
Dim r As Reflector
Dim Api As Int
Api = r.GetStaticField("android.os.Build$VERSION", "SDK_INT")
If Api < 9 Then
'Old device
id= ph.GetSettings("android_id")
Else
'New device
id= r.GetStaticField("android.os.Build", "SERIAL")
If id.ToLowerCase = "unknown" Then id= ph.GetSettings("android_id")
End If
Return id
End Sub
Has anyone else faced this issue? Any suggestions?
regards
carloz