Is it safe to use a code like this to get unique phone id? It works on my Android 10 phone today. But what about tomorrow? Or Advertising ID is a only safe way?
GenerateID:
Sub GenerateID() As String
Try
Dim P As Phone
Dim IDAndroid As String=P.GetSettings("android_id")
Log("IDAndroid=" & IDAndroid)
Return IDAndroid
Catch
Log("GenerateID " & LastException)
Return "Error"
End Try
End Sub
This is an old tutorial. It will not work on new versions of Android. You should either generate a random value when the app starts for the first time or use the advertising id: https://www.b4x.com/android/forum/threads/advertising-id.101050/#content This tutorial is based on the following blog...
So if the user just updates his app with new version (let say developer has made a few changes) via Google Play AdvertisingID won't change? Am I correct?
Is there an adb command that return same result as Phone.GetSettings ("android_id")?
"adb shell settings get secure android_id" is different that previouse code result.
"adb shell getprop ro.serialno" is also something else.