I used this code to get the imei number for the user device:
B4X:
Dim v As PhoneId
Dim imi As String
imi=v.GetDeviceId
Msgbox(imi,"")
unfortunately, some devices give me an empty Msgbox, what's the problem?
is there any other method that provide a unique value so I can use to recognize the device?
you may want to have a look at my lib dgUID. There you can find summarized all the methods discussed so far on the Forum.
About MAC addresses realibility; they can be changed by "smart" users and, worst, some manufacturers use the same "fake" MAC on several devices.
now I have tried, and found that Android serial is unique for my device and didn't change even after formatting, while Android ID, Random hash, Random UUID and MyUID changed after formatting.
is the Android serial relative to the built-in version of android in my device or a unique value for my device?
than you for help .. and sorry for bothering you
lib's function GetAndroidSerial returns the SERIAL string as defined here.
Reading its description "A hardware serial number, if available. Alphanumeric only, case-insensitive." it let me believe it's device-related not OS-related. But it states clearly that it could be not always defined.