题
问题是,当我在下面使用源代码时,我仅在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());
}
}
有什么方法可以将ID处于3G模式,尤其是对于UMTS?
解决方案
您获得的-1值对应于Unknown_CID常数的值,这表明单元位置不可用。
您可以在API中确认 这里.
它还指出,与您要获取的信息相关的GET方法,仅在GSM中工作。对于UMTS和CDMA,它与未知位置相同。
不隶属于 StackOverflow