Android Question Imei Number

khwarizmi

Active Member
Licensed User
Longtime User
Hello all

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?
 

khwarizmi

Active Member
Licensed User
Longtime User
thank you very much .. I wil read it
 
Upvote 0

khwarizmi

Active Member
Licensed User
Longtime User
is the Bluetooth mac address, or the WiFi mac address, a constant unique value?
 
Upvote 0

udg

Expert
Licensed User
Longtime User
Hi kattah,

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.

udg
 
Upvote 0

khwarizmi

Active Member
Licensed User
Longtime User
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
 
Upvote 0

udg

Expert
Licensed User
Longtime User
Hi kattah,

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.

udg
 
Upvote 0
Top