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")