Getting signal strength without activity

I need to get signal strength as part of an embedded work. There are no actions in my application, no services and broadcast receiver. Thus, in life-long conditions, my code only starts when the broadcast is in progress (for the state of a phone call).

My question is that I can hang up a PhoneStateListener, which will allow me to receive an event about signal strength when (or shortly afterwards) I ask for it.

Is the GSM signal strength not delivered as a broadcast event?

(I try not to use this listener in the service)

Thanks.

+4
source share
2 answers

My question is that I can hang up a PhoneStateListener, which will allow me to receive an event about signal strength when (or shortly afterwards) I ask for it.

You cannot configure any type of listener from the registered BroadcastReceiver manifest.

Is the GSM signal strength not delivered as a broadcast event?

As far as I can judge.

(I try not to use this listener in the service)

This is a wonderful goal. Are you sure you need signal strength?

+1
source

Since you intercept an outgoing call, you can use android.telephony.SignalStrength , if necessary, to decide whether to continue or not, instead of looking for broadcast signal transmission.

0
source

Source: https://habr.com/ru/post/1338708/


All Articles