How I'm in the emulator

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

How I'm in the emulator

Postby victorvieux » Sat May 30, 2009 1:28 am


I'm developping an app which can turn on/off the wifi.
I read we can't use wifi an emulator (is it still true ?) and it crach my app.

How could i know in java code, that i'm in the emulator (to invalidate some button) or in th real device.

Posts: 2
Joined: Wed May 27, 2009 7:04 pm


Postby Sowmya » Thu Jun 11, 2009 1:32 pm

For testing purpose you can use

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. new Build().MODEL
Parsed in 0.010 seconds, using GeSHi

which will return "sdk" or something like that(android.os package).Then You can make a check using if loop for "sdk" (given by the emulator).

Hope this helps
Experienced Developer
Experienced Developer
Posts: 51
Joined: Fri Mar 06, 2009 7:49 am


Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 1 guest