getNeighboringCellInfo在samsung中返回一个空值

时间:2014-11-25 11:46:02

标签: android

相邻单元格信息始终在大多数设备中返回空值。此外,我发现一篇文章建议使用getCellAllInfo,但仅支持API 17及更高版本。请建议我解决方案,以获得至少3的蜂窝塔信息。

以下是我的代码:

TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
        GsmCellLocation cellLocation = (GsmCellLocation) telephonyManager
                .getCellLocation();

    String networkOperator = telephonyManager.getNetworkOperator();
    String mcc = networkOperator.substring(0, 3);
    String mnc = networkOperator.substring(3);
    int cid = cellLocation.getCid();
    int lac = cellLocation.getLac();
    int psc = cellLocation.getPsc();
    List<NeighboringCellInfo> NeighboringList = telephonyManager
     .getNeighboringCellInfo();
    int = NeighboringList.size()

Here is the screenshot of the values I have received with the code I have posted

0 个答案:

没有答案