SignalStrength isGsm - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for SignalStrength isGsm method.

This code example shows how to use the following methods:getCdmaDbm, getEvdoDbm, isGsm
		final PhoneStateListener mSignalListener = new PhoneStateListener(){ 
 
			@Override 
			public void onSignalStrengthsChanged(SignalStrength signalStrength) 
			{  
				if (signalStrength.isGsm()) 
					ASU = signalStrength.getGsmSignalStrength(); 
				else{  
					int strength = -1; 
					if (signalStrength.getEvdoDbm() < 0) 
						strength = signalStrength.getEvdoDbm(); 
					else if (signalStrength.getCdmaDbm() < 0) 
						strength = signalStrength.getCdmaDbm(); 
					if (strength < 0){ 
						// convert to asu  
						ASU = Math.round((strength + 113f) / 2f); 
					}  
				}  
				super.onSignalStrengthsChanged(signalStrength);
				StringBuffer output = new StringBuffer();
6
CodeRank
This code example shows how to use the following methods:getCdmaDbm, getCdmaEcio, getEvdoDbm, getEvdoEcio, getEvdoSnr
		 
		public void onSignalStrengthsChanged (SignalStrength signalStrength)
		{ 
			String strength = "-1";
			if (signalStrength != null) {
				if (signalStrength.isGsm()) {
					strength = "" + signalStrength.getGsmSignalStrength();
				} 
				if (signalStrength.getCdmaDbm() > 0) {
					strength = signalStrength.getCdmaDbm() + "dBm ";
					strength += signalStrength.getCdmaEcio() + "Ec/lo";
				} 
				else if (signalStrength.getEvdoDbm() > 0) {
					strength = signalStrength.getEvdoDbm() + "dBm ";
					strength += signalStrength.getEvdoEcio() + "Ec/lo ";
					strength += signalStrength.getEvdoSnr() + "snr";	
				} 
				getTelephoneManager().listen(phoneStateListener, PhoneStateListener.LISTEN_NONE);
				//responseListener.onCompleteSignal(strength); 
				signalResult.gotSignal(strength);
			} 
6
CodeRank
This code example shows how to use the following methods:getCdmaDbm, getCdmaEcio, getEvdoDbm, getEvdoEcio, getEvdoSnr
            s.append("  LTE RSRQ=").append(getFieldValue(signal, "mLteRsrq"))
                .append('\n');
        } 
 
        // output GSM information. 
        if (signal.isGsm()) {
            s.append("  GSM RSSI=").append(signal.getGsmSignalStrength())
                .append('\n');
            s.append("  GSM bit error rate=")
                .append(signal.getGsmBitErrorRate())
                .append('\n');
        } 
 
        // output CDMA information. 
        s.append("  CDMA RSSI=").append(signal.getCdmaDbm())
            .append('\n');
        s.append("  CDMA ECIO=").append(signal.getCdmaEcio() / 10)
            .append('\n');
 
        // output EVDO information. 

6
CodeRank
This code example shows how to use the following methods:getCdmaDbm, getCdmaEcio, getEvdoDbm, getEvdoEcio, getEvdoSnr
 
		@Override 
		public void onSignalStrengthsChanged(SignalStrength signalStrength) {
			super.onSignalStrengthsChanged(signalStrength);
 
			boolean	isGsm = signalStrength.isGsm();
			// Get the CDMA RSSI value in dBm 
			int	iCdmaDbm = signalStrength.getCdmaDbm();
			// Get the CDMA Ec/Io value in dB*10 
			int	iCdmaEcio = signalStrength.getCdmaEcio();
			// Get the EVDO RSSI value in dBm 
			int	iEvdoDbm = signalStrength.getEvdoDbm();
			// Get the EVDO Ec/Io value in dB*10 
			int	iEvdoEcio = signalStrength.getEvdoEcio();
			// Get the signal to noise ratio. Valid values are 0-8. 8 is the highest. 
			int	iEvdoSnr = signalStrength.getEvdoSnr();
			// Get the GSM bit error rate (0-7, 99) as defined in TS 27.007 8.5 
			int	iGsmBitErrorRate = signalStrength.getGsmBitErrorRate();
			// Get the GSM Signal Strength, valid values are (0-31, 99) as defined in TS 27.007 8.5 
			int	iGsmSignalStrength = signalStrength.getGsmSignalStrength();

7
CodeRank
This code example shows how to use the following methods:getCdmaDbm, getEvdoDbm, getGsmSignalStrength, isGsm
        @Override 
        public void onSignalStrengthsChanged(SignalStrength signal) {
            super.onSignalStrengthsChanged(signal);
            Intent intent=new Intent(NegiAntennaService.this,NegiAntennaService.class);
            intent.setAction(ACTION_UPDATE);
            Log.d("NegiAntennaService", "signal: " + signal.getGsmSignalStrength());
            if (signal.isGsm()) {
                intent.putExtra("sig",signal.getGsmSignalStrength());
            } else { 
                int strength = 0;
                if (signal.getEvdoDbm() < 0)
                  strength = signal.getEvdoDbm();
                else if (signal.getCdmaDbm() < 0)
                  strength = signal.getCdmaDbm();
 
                if (strength < 0){
                    intent.putExtra("sig",Math.round((strength + 113f) / 2f));
                } else { 
                    intent.putExtra("sig",-1);
                } 
5
CodeRank
This code example shows how to use the following methods:getCdmaDbm, getCdmaEcio, isGsm
			builder.append(cdmaLocation.getBaseStationLongitude());
			builder.append(cdmaLocation.getNetworkId());
			builder.append(cdmaLocation.getSystemId());
		} 
		 
		if (signal.isGsm()) {
			builder.append(signal.getGsmSignalStrength());
			builder.append(signal.getGsmBitErrorRate());
		} else { 
			builder.append(signal.getCdmaDbm());
			builder.append(signal.getCdmaEcio());
		} 
		list.add(builder.build());
	} 
 
	 
	 
	 
	@Override 
	public List<JSONObject> getPassiveMetric() {
5
CodeRank
This code example shows how to use the following methods:getCdmaDbm, getGsmSignalStrength, isGsm, toString
        // mServiceState.getState(); 
    } 
 
    private void updateSignalStrength() 
    { 
        LOGD("onSignalStrengthsChanged mSignalStrength:" + mSignalStrength.toString());
        int asu = mSignalStrength.getGsmSignalStrength();
 
        int dBm = -1;
 
        if (!mSignalStrength.isGsm())
        { 
            dBm = mSignalStrength.getCdmaDbm();
        } else 
        { 
            asu = (asu == 99 ? -1 : asu);
            if (asu != -1)
            { 
                dBm = -113 + 2 * asu;
            } 
5
CodeRank
This code example shows how to use the following methods:getGsmBitErrorRate, getGsmSignalStrength, isGsm
		 
		JSONObject json = new JSONObject();        
 
        try 
        { 
        	if (signal.isGsm())
        	{ 
        		json.put("signal", signal.getGsmSignalStrength());
        		json.put("biterror", signal.getGsmBitErrorRate());
        	} 
        } 
        catch (JSONException e)
        { 
            Log.e(TAG, "Exception", e);
        }		 
        mDbAdaptor.createEntry(json, SIGNALSTRENGTH);
		//Log.i(TAG, "onSignalStrengthChanged to " + signal.toString()); 
	} 
 
	 
5
CodeRank
This code example shows how to use the following methods:getCdmaDbm, isGsm
	public void onSignalStrengthsChanged(SignalStrength signalStrength)
	{ 
		super.onSignalStrengthsChanged(signalStrength);
 
 
		if (signalStrength.isGsm()) {
			//convert to dBm  
			//http://www.etsi.org/deliver/etsi_ts/127000_127099/127007/08.05.00_60/ts_127007v080500p.pdf 
			//GSMsig = signalStrength.getGsmSignalStrength() * 2 - 113; 
			GSMsig = signalStrength.getGsmSignalStrength();
			setGSMPhone(true);  
 
		} else { 
 
			//convert to ETSI standard as dBm conversion is completed later 
			CDMAsig = (signalStrength.getCdmaDbm() + 113) / 2;
			setGSMPhone(false); 
		} 
 
 
	} 
5
CodeRank
This code example shows how to use the following methods:getGsmSignalStrength, isGsm
                setCurrentRssi(signalStrength.getCdmaDbm());
            } else if (getNetwork().compareTo(NETWORK_TYPES[TelephonyManager.NETWORK_TYPE_EVDO_0]) == 0 ||
                    getNetwork().compareTo(NETWORK_TYPES[TelephonyManager.NETWORK_TYPE_EVDO_A]) == 0 ||
                    getNetwork().compareTo(NETWORK_TYPES[TelephonyManager.NETWORK_TYPE_EVDO_B]) == 0) {
                setCurrentRssi(signalStrength.getEvdoDbm());
            } else if (signalStrength.isGsm()) {
                if (signalStrength.getGsmSignalStrength() != 99)
                    setCurrentRssi(signalStrength.getGsmSignalStrength() * 2 - 113);
                else 
                    setCurrentRssi(signalStrength.getGsmSignalStrength());
            } 
 
            update(); 
        } 
    } 
} 
4
CodeRank
isGsm Method Overview
See Code Examples for other Android SignalStrength Methods: