我正在创建一个带有信号信息的android应用,我想访问android库,通过它可以看到所有邻居单元格,如下图所示。有人知道我怎么做吗? 我已经尝试过下面的代码,但结果不是我想要的
List<NeighboringCellInfo> NeighboringList = tm.getNeighboringCellInfo();
String stringNeighboring = "Lac : Cid : RSSI\n";
for(int i=0; i < NeighboringList.size(); i++){
String dBm;
int rssi = NeighboringList.get(i).getRssi();
if(rssi == NeighboringCellInfo.UNKNOWN_RSSI){
dBm = "Unknown RSSI";
}else{
dBm = String.valueOf(-113 + (2 * rssi)) + " dBm";
}
stringNeighboring = stringNeighboring + String.valueOf(NeighboringList.get(i).getLac()) +" : " + String.valueOf(NeighboringList.get(i).getCid()) +" : " + dBm +"\n";
}