如何获得LTE信号强度的Andr​​oid?如何获得、强度、信号、oid

2023-09-12 06:24:51 作者:我命缺她^

我使用的HTC霹雳Verizon的新的LTE手机。我找不到API来查询信号强度,而手机是在LTE上。通过输入现场测试模式(#的#4636#的#的),我可以看到信号强度为-98dBm 2亚利桑那州立大学。任何人都知道什么样的API,我可以用得到这些信息?

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 mode (##4636##), I can see signal strength as -98dBm 2 asu. Anyone know what API I could use to get this info?

推荐答案

为了解决这个问题,我创建的 GitHub上。在我过去的经验,有些设备运行Android ICS 4.0及以上有一个 getLevel SignalStrength 方法,返回由一个整数0 - 4报告的信号强度。在一些其他的LTE设备(我不相信HTC霹雳),有喜欢 getLteCqi getLteRsrp getLteRsrq 和 getLteRssnr ,我将离开你来决定如何使用这些值来计算信号强度。最后,我发现,在某些设备上(我相信HTC霹雳)的LTE信号的强度其实是与报道标示GSM信号强度的方法!它的疯狂,但却是事实。随意下载信号强度检测,并检查了设备上的结果和/或修改code是必要的。

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.

作为一个方面说明,您将需要使用反射来访问这些方法,再一次,我将离开你来决定如何最好地实现这一点。这是相当简单的,但你需要做大量的try-catch来确定方法为present,有时 setAccessible(真)只是忽略任何问题与私有方法。

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.

希望这有助于!