Ateeq
Ateeq

Reputation: 520

Android CellSignalStrength (when network type is UMTS)

Can any body know how to get CellSignalStrength i.e getDbm() When Network type is UMTS. When the network type is LTE or GSM we can use classes like http://developer.android.com/reference/android/telephony/CellSignalStrengthLte.html

But dnt know how to get UMTS SignalStrength and is there any class provided by android for this? please help me out

Upvotes: 2

Views: 2315

Answers (1)

Ateeq
Ateeq

Reputation: 520

Answer to my Question is You should use CDMA http://developer.android.com/reference/android/telephony/CellSignalStrengthCdma.html

Because UMTS is type of CDMA so I think it should work.

The Code I am using for GSM,LTE,UMTS is this and its working fine for me.

  public void onSignalStrengthsChanged(SignalStrength signalStrength) {
            super.onSignalStrengthsChanged(signalStrength);

                 CellSignalStrengthLte1 a1=new CellSignalStrengthLte1();
                a1.initialize(signalStrength, 1);
                MyService.signal=a1.getDbm();

                if(MyService.signal>0){
                    CellSignalStrengthGsm1 a3=new CellSignalStrengthGsm1();
                a3.initialize(signalStrength.getGsmSignalStrength(), 1);
                MyService.signal=a3.getDbm();

                    }

                if(MyService.signal>0)
                {
                    CellSignalStrengthCdma1 a2=new CellSignalStrengthCdma1();
                    a2.initialize(signalStrength.getCdmaDbm(),signalStrength.getCdmaEcio(),signalStrength.getEvdoDbm(), signalStrength.getEvdoEcio(),signalStrength.getEvdoSnr());
                    MyService.signal=a2.getDbm();


                }



        }

Upvotes: 2

Related Questions