public static boolean isEmulator() {
String id = Settings.Secure.getString(this.getContentResolver(), Settings.Secure.ANDROID_ID);
boolean emulator = TextUtils.isEmpty(id);
if (!emulator) {
emulator = id.toUpperCase().equals("9774D56D682E549C");
}
return emulator;
}
ANDROID_ID is null on 'old' emulators, since 2.2 the id is always '9774D56D682E549C'.
Hope this help ;)
