android - getgsmsignalstrength giving me 99 in Samsung Galaxy S2 -
i tried track gsm signal strength "getgsmsignalstrength" in galaxy s2. keeps giving value 99. when phone got signal 4 bar said 99.
here code
public class myphonestatelistener extends phonestatelistener { static signalstrength msignalstrength; static int signal; public static void signal() { signal = msignalstrength.getgsmsignalstrength(); } }
then called class,
signal2 = myphonestatelistener.signal; if (signal2 <= 2 || signal2 == 99) strength="no signal"; else if (signal2 >= 12) strength="very strong"; else if (signal2 >= 8) strength="strong"; else if (signal2 >= 5) strength="weak"; else strength="very weak";
it "no signal" though watching out signal bar , showed 2 or 3 bars.
does know why keep giving me value or how solve ? appreciated answers or respond.
initialize msignalstrength below code :
msignalstrength = phonestatelistener.listen_signal_strengths
Comments
Post a Comment