Detect emulator?

NJDude

Expert
Licensed User
Longtime User
You could use: (You will need to reference the Phone library)

B4X:
Dim pID As PhoneId

If pID.GetDeviceId  = "000000000000000" Then '15 zeroes

   MsgBox("Running on emulator", "")

End If

Some clone/cheap devices might have zeroes there as well.
 
Last edited:
Upvote 0

straybullet

Member
Licensed User
Longtime User
Thanks for the tip!

You could use: (You will need to reference the Phone library)

B4X:
Dim pID As PhoneId

If pID.GetDeviceId  = "000000000000000" Then '15 zeroes

   MsgBox("Running on emulator", "")

End If

Some clone/cheap devices might have zeroes there as well.
 
Upvote 0
Top