tags:

views:

40

answers:

1

I made an aplication that shows actual wifi conection information.

      cont = act.getApplicationContext();
        wifiManager = (WifiManager)cont.getSystemService(Context.WIFI_SERVICE);
  display.setText(cadena + "\n Rssi:" + wifiManager.getConnectionInfo().getRssi() 
    + "\n BSSID: " +
    wifiManager.getConnectionInfo().getBSSID()
    + "\n wifiState: " +
    wifiManager.getWifiState()
    + "\n SSID: " +
    wifiManager.getConnectionInfo().getSSID()
    + "\n LinkSpeed: " +
    wifiManager.getConnectionInfo().getLinkSpeed()
    + "\n NetworkId: " +
    wifiManager.getConnectionInfo().getNetworkId());

The app shows the values correctly exept for the Rssi, i shows -200, no matter if i'm conected to a wifi net or not.

I don´t have a phone to test it, but i have a pc with Android for pc.

The Android SDK emulator doesn't conect via wifi but getRssi() still return -200.

Is -200 some kind of "error value"?

A: 

I think so - at least it can be found in the Android source code, see here (line 1412): http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=wifi/java/android/net/wifi/WifiStateTracker.java;h=aef93c6286f8a7a4695d6ae87246969d260790c1;hb=38f534882eb9214b4c1a8035990157f941762f85#l1412

It's not a defined constant if you wanted to know that.

I suggest you should not use the emulator for WiFi-related testing. Maybe you can borrow a real Android device somewhere. Or just go ahead and buy one - the new Android devices really are awesome! :-D

mreichelt