Reputation: 644
I was wondering if anyone knew how to programmatically get the SNR or signal to noise ratio of LTE/WCDMA signals in Android phones. The SNR can be viewed from a secret code *#0011# in Samsung models but not in other phones such as Nexus 5. I was thinking if there isn't an actual API, maybe a calculation from existing APIs?
I know for a fact you can get detailed information on signals with the SignalStrength API but I've parsed the parts I saw and can't seem to find any SNR readings.
Any help or suggestions is greatly appreciated!
Thanks!
Additional Information:
I should add that I've been tinkering around with Signal Strength from this thread [link] How to get LTE signal strength in Android? and so that's my starting point for my question.
My results are for the following are:
LteSignalStrength -> fluctuates between around 15-30 depending on location, no idea what this is..
LteRsrp -> shows the dBm, I guess this is how phones determine signal quality (roughly anyway).
LteRsrq -> shows -7 to -11, not sure
LteRssnr -> always 300 for some reason, no idea why...
LteCqi -> Channel Quality Indicator? some huge number that seems to be the max 32-bit integer value, not sure
Is there a way to get to SNR from this API or am I looking for a nonexistent needle in a haystack?
Screenshot of Samsung GalaxyNote2 with SNR reading from *#0011# secret code:
Upvotes: 9
Views: 16239
Reputation: 124
I use the following to get the SNR:
public class PhoneStateListener extends android.telephony.PhoneStateListener
{
@Override
public void onSignalStrengthsChanged(SignalStrength signalStrength)
{
double snr = (double) SignalStrength.class.getMethod("getLteRssnr").invoke(signalStrength)/10D;
}
}
You just need to register for signal events:
TelephonyManager mTelephonyManager = (TelephonyManager) getSystemService(TELEPHONY_SERVICE);
PhoneStateListener mPhoneStateListener = new PhoneStateListener();
mTelephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_SIGNAL_STRENGTHS);
Upvotes: 3
Reputation: 2095
I'm researching this subject intensively since Aug-2014. Firstly, I hope that you're familiar with some telecom knowledge and Android Open Source Project (AOSP). Well, based on my researches, I state that:
Based on the above, I suppose that:
I hope that it brings some light to you. If you have any additional information, please share it here.
Upvotes: 12