This post could be clearer. It seems that SystemProperties is now available via the public API, i.e. you can only use it if you’re building against the actual source files, which you shouldn’t do unless you are building a custom Android.
(Note that Build.MODEL is not “google_sdk” for Google’s Cupcake emulator (it’s “sdk”), and it’s other things for 3-rd party emulators (like Samsung’s Galaxy Tab and Sony Erikson’s EDK).
November 22nd, 2009 at 7:40 pm
android 2.0 is great
January 30th, 2011 at 7:51 am
i dont see a class called SystemProperties in android, and don’t see that property in System.getProperty()… where do you get this property?
January 31st, 2011 at 9:58 pm
This post could be clearer. It seems that SystemProperties is now available via the public API, i.e. you can only use it if you’re building against the actual source files, which you shouldn’t do unless you are building a custom Android.
You can try to exec “getprop” though:
http://stackoverflow.com/questions/2641111/where-is-android-os-systemproperties
February 19th, 2011 at 1:59 pm
if(android.os.Build.MODEL.equals(“google_sdk”)){
// emulator
}else{
//not emulator
}
July 28th, 2011 at 10:37 pm
boolean inEmulator = “generic”.equals(Build.BRAND);
(Note that Build.MODEL is not “google_sdk” for Google’s Cupcake emulator (it’s “sdk”), and it’s other things for 3-rd party emulators (like Samsung’s Galaxy Tab and Sony Erikson’s EDK).