Code example for SignalStrength

Methods: getCdmaDbm, getEvdoDbm, isGsm

0
                    public void onSignalStrengthsChanged(SignalStrength signalStrength)
                    { 
                            super.onSignalStrengthsChanged(signalStrength);
                            
                            int strengthDbm = -1;
                            if (signalStrength.isGsm()){
                            	 
                                    strengthDbm = -140 + 2 * signalStrength.getGsmSignalStrength();
                            } else { 
                                    strengthDbm = signalStrength.getCdmaDbm();
                                    if (strengthDbm == -1){
                                            strengthDbm = signalStrength.getEvdoDbm();
                            }} 
                            updateSignalStrength(strengthDbm);
                    } 
            }; 
    } 
    
    private void updateSignalStrength(int strengthDbm) {
        this.webView.sendJavascript("domCallbacks.cellularSignal(" + strengthDbm + ")");  
    }