Determining whether target is an emulator or phone at runtime
In android, is there a way to determine whether an emulator or a phone is being used at runtime?
The reason: I ask because I am using opengl in my app, which doesn't work on the emulator. So I would like to be able to shut opengl down automatically 开发者_StackOverflow社区(or never start it up) when an emulator is used so I can still test the other parts of my app on the emulator.
if(Build.MANUFACTURER.equals("unknown")) {
// Emulator
}
else {
// Not Emulator
}
精彩评论