that will specify which SDK the app is using.

I am attempting to discern if the app is running in the emulator or on a real device.

hmmm,  this might do the trick after some spleunking, but....

if (android.os.Build.DEVICE.equals("generic"))
    if (android.os.Build.BRAND.equals("generic"))
         emulator = 1;



there is also a BOARD field which is "unknown" on the emulator.



any takers on this ????




----- Original Message ----- From: "Diego Torres Milano" <[email protected]>
To: "Android Discuss" <[email protected]>
Sent: Sunday, February 07, 2010 5:43 PM
Subject: [android-discuss] Re: Query From Java You are In Emulator Running


Use something like this:

private static boolean runningOnEmulator() {
return android.os.Build.MODEL.equals("sdk");
}

On Feb 7, 8:14 pm, "paul zazzarino" <[email protected]>
wrote:
Is there a way to dynamically query from source code if you are in the emulator vs a real device ?

if (IsEmulator())
DoCodeForEmulator()
else
DoCodeForAnyRealDevice()

--
Have you read my blog ?
http://dtmilano.blogspot.com
android junit tests ui linux cult thin clients

--
You received this message because you are subscribed to the Google Groups "Android Discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/android-discuss?hl=en.

--
You received this message because you are subscribed to the Google Groups "Android 
Discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/android-discuss?hl=en.

Reply via email to