Like in Blackberry, do we have any API method (similar to DeviceInfo.isSimulator()
) to check if device is simulator or real device?
Asked
Active
Viewed 4,081 times
3

Jason Plank
- 2,336
- 5
- 31
- 40

Android Developer
- 127
- 2
- 5
-
4possible duplicate of [How can I detect the Android emulator?](http://stackoverflow.com/questions/2799097/how-can-i-detect-the-android-emulator) – Colin Hebert Oct 04 '10 at 11:46
1 Answers
1
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.
}

Alex Lockwood
- 83,063
- 39
- 206
- 250
-
1Other suggestions can be found here: http://stackoverflow.com/questions/2799097/how-can-i-detect-when-an-android-application-is-running-in-the-emulator?answertab=votes#tab-top – AgentKnopf Jan 03 '13 at 10:42