开发者

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.
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜