2

我试图通过以下代码获取我所在位置可用的所有 GSM 网络的列表 -

    TelephonyManager telManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
    telManager.listen(gsmListener, PhoneStateListener.LISTEN_SIGNAL_STRENGTHS);

    List<NeighboringCellInfo> cellInfo = telManager.getNeighboringCellInfo();
    StringBuilder sb =new StringBuilder("");
    for(NeighboringCellInfo nInfo : cellInfo) {
        sb.append("\ncid: "+ nInfo.getCid()+" lac: "+ nInfo.getLac()+" n/w type: "+ nInfo.getNetworkType()+" psc: "+ nInfo.getPsc()+" rssi: "+ nInfo.getRssi()+"\n");
    }
    String disp = "Connected to: "+telManager.getNetworkOperatorName()+"||"+telManager.getSimOperatorName() +"\nrssi: "+strength+" || "+telManager.getLine1Number()+"\n\nNeighbours "+cellInfo.size()+sb.toString();



   This gives me the cell id, LAC, network type, PSC, RSSI of neighbouring cell.

   How can i get the network operator's name of neighbouring cell.
4

0 回答 0