views:

34

answers:

1

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?

+1  A: 

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.

Luis Miguel
So as i understand there no possible methods to receive this info with current level of API?
StalkerRus
That's right. Gievn the current state of things, it does seem that way.
Luis Miguel