Device Id


Well-Known Member
Licensed User
Longtime User
Good morning Community!
In B4A how obtain the device ID ?
I mean a name/code that identify (Unique) the Android device within all others devices ?


Active Member
Licensed User
Longtime User
if its a GSM device (mobile phone), then you can get imei by;
Dim pID As PhoneId
Dim imei As String

imei = pID.GetDeviceId
you need to enable Phone library in the Libs Tab.

For Non-GSM devices (tablets), you can either get "android_id" or mac address.
Dim phn As Phone
Dim androidID As String
' For android_id
androidID = phn.getSettings("android_id")
Last edited:
Upvote 0