Android SignalStrength - top ranked examples from Open Source projects

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

This code example shows how to use the following methods: getAsuLevel
        // TODO: use new SignalStrength instead of asu 
        if ((mWants & NOTIF_SIGNAL) == 0) {
            throw new RuntimeException
                ("client must call notifySignalStrength(int)"); 
        } 
        return mSignalStrength.getAsuLevel();
    } 
 
    /** 
     * Return current signal strength in "dBm", ranging from -113 - -51dBm 
     * or -1 if unknown 
     * 
     * @return signal strength in dBm, -1 if not yet updated 
     * Throws RuntimeException if client has not called notifySignalStrength() 
     */ 
    public int getSignalStrengthDbm() { 
        if ((mWants & NOTIF_SIGNAL) == 0) {
            throw new RuntimeException
                ("client must call notifySignalStrength(int)"); 
        } 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getCdmaDbm, getCdmaEcio, getEvdoDbm, getEvdoEcio, getEvdoSnr
		} 
 
		@Override 
		public void onSignalStrengthsChanged(SignalStrength s) {
			super.onSignalStrengthsChanged(s);
			String r = s.getGsmSignalStrength() + ":" + s.getCdmaDbm() + ":"
					+ s.getCdmaEcio() + ":" + s.getEvdoDbm() + ":"
					+ s.getEvdoEcio() + ":" + s.getEvdoSnr() + ":"
					+ s.getGsmBitErrorRate();
			view.loadUrl("javascript:droid.GSM.__onSignalStrengthChange('" + r
					+ "');"); 
		} 
 
		@Override 
		public void onSignalStrengthChanged(int asu) {
			android.util.Log.v("", "onSignalStrengthChanged: " + asu);
		} 
		 
	} 
 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
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);
			} 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
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();
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getCdmaDbm, getCdmaEcio, getEvdoDbm, getEvdoEcio, getEvdoSnr
		 
		return true; 
	} 
	public void onSignalStrengthsChanged (SignalStrength signalStrength)
	{ 
		values[0] = signalStrength.getCdmaDbm()&0x1;
		bits[0] = 1;
		values[1] = signalStrength.getEvdoDbm()&0x1;
		bits[1] = 1;
		Log.d("Data: ",signalStrength.getCdmaDbm()+", "+signalStrength.getEvdoDbm()+", "+signalStrength.getCdmaEcio()+", "+signalStrength.getEvdoEcio()+", "+signalStrength.getEvdoSnr());
	} 
} 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android SignalStrength Questions & Answers:

See Code Examples for Android SignalStrength Methods: