Checking if Android phone is simulator or real device
Like in Blackberry, do we have any API method (similar t开发者_JS百科o DeviceInfo.isSimulator()
) to check if device is simulator or real device?
There isn't a 100% correct way to do this since the internal constants seem to change every once in a while. This works for me though:
if (android.os.Build.MODEL.contains("google_sdk") ||
android.os.Build.MODEL.contains("Emulator")) {
// Then you are running the app on the emulator.
}
精彩评论