1

我可以使用下面的代码获得第一个 sim cell tower id。但我想获得第二个 sim2 单元格 ID。

    TelephonyManager telephonyManager = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
    GsmCellLocation cellLocation = (GsmCellLocation) telephonyManager.getCellLocation();
  int   nowcid  = cellLocation.getCid();
  int nowlac = cellLocation.getLac();

对此有很多疑问。但我用 android 6.0 samsung j7 2016 测试了所有代码,但没有得到 sim2 单元格 ID。有人说这在其他问题上是不可能的,但是 Network Cell Info Lite 应用程序https://play.google.com/store/apps/details?id=com.wilysis.cellinfolite&hl=en 在我测试的每台设备上从 sim2 获取单元格 ID .

4

1 回答 1

0

对于 MediaTek 设备,有隐藏类 com.mediatek.telephony.TelephonyManagerEx。使用反射来访问这个类。这应该在 MTK 设备上可靠工作。使用的 simId 参数对于 SIM 0 值为 0,对于 SIM 2 值为 1。

研究很难找到的 API 描述:http ://www.lcis.com.tw/paper_store/ps_html/MediaTek_SDK_for_Android_Developers_Guide_v1_0-2016103002732388.pdf.html

有一个静态getDefault方法。

对于基于 Qualcomm 的手机,TelephonyManager 中有隐藏的方法。就TelephonyManager.class.getDeclaredMethods()在调试器里面看看有什么可用的。

于 2018-01-28T21:25:34.670 回答