How to get LTE signal strength in Android?

前端 未结 4 849
渐次进展
渐次进展 2020-12-02 19:13

I am using Verizon\'s new LTE handset from HTC Thunderbolt. I cannot find the API to query for the signal strength while the handset is on LTE. By entering the field test mo

4条回答
  •  一整个雨季
    2020-12-02 19:46

    In order to solve this question I created an application called Signal Strength Detector and with source code on GitHub. In my past experience, some devices running Android ICS 4.0 and up have a getLevel method on SignalStrength that returns an integer from 0 - 4 reporting the signal strength. On some other LTE devices (I do not believe the HTC Thunderbolt), there are some methods like getLteCqi getLteRsrp getLteRsrq and getLteRssnr which I will leave to you to determine how to use these values to calculate a signal strength. Finally, I found that on some devices (I believe the HTC Thunderbolt) the LTE signal strength is actually reported with the methods labelled for GSM signal strength! It's crazy, but true. Feel free to download Signal Strength Detector and check out the results on your device and/ or modify code as necessary.

    As a side note, you will need to use Reflection to access these methods, again which I will leave to you to determine how to best implement this. It's fairly simple, but you need to do a lot of try-catch to determine if the method is present, and sometimes setAccessible(true) just to ignore any issues with private methods.

    Hope this helps!

提交回复
热议问题