问题是,当我使用下面的源代码时,我只在2G模式下接收小区id,如果我切换到3G模式,我有时会收到HSDPA的-1或UMTS的没有。源码是:
for (int i = 0; i < neighCell.size(); i++) {
try {
NeighboringCellInfo thisCell = neighCell.get(i);
int thisNeighCID = thisCell.getCid();
int thisNeighRSSI = -113 + 2*thisCell.getRssi();
log("Base station "+(i+1)+":"+
"\nCellID: "+thisNeighCID+
"; RSSI: "+thisNeighRSSI+" dBm");
} catch (NumberFormatException e) {
e.printStackTrace();
NeighboringCellInfo thisCell = neighCell.get(i);
log(thisCell.toString());
}
}有没有办法在3G模式下获取id,尤其是UMTS?
发布于 2010-10-12 07:20:11
您得到的-1值对应于UNKNOWN_CID常量的值,该常量表示单元格位置不可用。
您可以在here接口中确认。
它还指出,与您想要获取的信息相关的get方法仅在GSM中有效。对于UMTS和CDMA,它将它们视为未知位置。
https://stackoverflow.com/questions/3909575
复制相似问题