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

Hello,

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.


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

Top

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.030 seconds, using GeSHi 1.0.8.4


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
Sowmya
Experienced Developer
Experienced Developer
 
Posts: 51
Joined: Fri Mar 06, 2009 7:49 am

Top

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 4 guests