Question

The problem is that when I use source code below, i receive cell id's only in 2G mode, if i switch to 3G mode i sometimes receive -1 for HSDPA or nothing for UMTS. Source code is:

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());
}
    }

Is there any way to get id's in 3G mode and especially for UMTS?

Was it helpful?

Solution

The -1 value you are getting corresponds to the value of the UNKNOWN_CID constant, which indicates the cell location is not available.

You can confirm this in the API here.

It also states that the get methods related with the information you want to acquire, only work in GSM. For UMTS and CDMA it treats them the same as unknown location.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top