Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android emulator signal strength

Is there any way to simulate changes in signal strength on the android emulator. I have a phonestatelistener logging signal strength in my app. I'm also using telnet to the emulator and commands like gsm signal 5 5, but I keep getting 99 as my rssi signal strength and -1 as the bit error rate.

like image 521
MEURSAULT Avatar asked Jun 25 '12 19:06

MEURSAULT


1 Answers

I think it's good idea to mock with interface in such cases

interface SignalInformation{
    float signalStrength();
    //etc...
}

Create some dummy class for mocking, and then change it to real working class.

class MockSignal implements SignalInformation{

    public float signalStrength(){
        return 3.5; //or whatever behaviour you want (i.e. random number)
    }
}

Well, I hope you got the idea.

like image 152
Dmitry Zaytsev Avatar answered Sep 16 '22 18:09

Dmitry Zaytsev