Hey I tried for signalStrength.getGsmSignalStrength() for GSM and CDMA devices but I noticed that both the devices gives strength even when sim is not inserted in device.I want to place a call or send message only if network is good how can I achieve this? And also want to know which signal strength this API returns!!... Please reply as soon as possible.
public class AndroidPhoneStateListener extends PhoneStateListener {
public static int signalStrengthValue;
@Override
public void onSignalStrengthsChanged(SignalStrength signalStrength) {
super.onSignalStrengthsChanged(signalStrength);
if (signalStrength.isGsm()) {
if (signalStrength.getGsmSignalStrength() != 99)
signalStrengthValue = signalStrength.getGsmSignalStrength() * 2 - 113;
else
signalStrengthValue = signalStrength.getGsmSignalStrength();
} else {
signalStrengthValue = signalStrength.getCdmaDbm();
}
}
}