title: Neighbouring cell information is inaccurate
body: <p>I'm trying to make use of a mobile information about neighbouring cells, available on Android via <code>TelephonyManager</code> class and its <code>getNeighboringCellInfo</code> method. Below I'm posting a part of code (mostly taken from publicly available sources) which does the job, and one example of output which this code produces (shown in attached screenshot). The code and the image are placed "as is" without any changes, so it should be relatively easy to associate one with the other and make sure it should work correctly (of course, there can be errors which I overlooked).</p>
  
  <p>The problem is that the list of neighbouring cells does often contain elements with "incorrect" (to my understanding) data, such as:</p>
  
  <ol>
  <li>a <code>NeighboringCellInfo</code> with all properties - <code>lac</code>, <code>cid</code>, <code>psc</code> - set to -1, and only <code>rssi</code> field seems meaningful;</li>
  <li>a <code>NeighboringCellInfo</code> with <code>lac</code> equal to 0; does this mean that the <code>lac</code> is the same as current active cell?</li>
  <li>a <code>NeighboringCellInfo</code> with <code>rssi</code> value outside the range [0, 31] and not <code>UNKNOWN_RSSI</code>; such values can be as positive (33, as shown in the screenshot), as negative (they look like a proper raw rssi value, that is without the need to convert from <code>asu</code>);</li>
  <li>list elements obtained in the same geolocation do not demonstrate consistency as much as I'd expect, that is in two consecutive scans every one can have an element omitted in the other one, and the omitted elements' rssi levels are not of a most low level in the list (in fact their rssi's can be larger than for currently used cell); I admit this could be right behaviour if every cell signal tends to be <strong>very</strong> unstable, but I'm not sure if it's true in general for GSM and/or UMTS networks. Current cell always has all fields defined well, but its rssi can vary very quickly in a range of 30 dBm (say from -60 to -90).</li>
  <li>The same as 4, but about consistency from one day to another. In a highly urbanized and matured environment I'd expect to see the same list of cells every day, yet they vary in such a way, that one day I don't even see a mention about a cell that was active cell in a previuos day.</li>
  </ol>
  
  <p>Does all this mean a normal functioning of mobile technology, some sort of possibly powersaving optimizations, or a flaw in a specific device (LG Optimus One in my case)?</p>
  
  <p>Please suggest how can one obtain consistent readings from cell environment on Android, if this is possible.</p>
  
  <pre><code>GsmCellLocation cellLocation = (GsmCellLocation)telephonyManager.getCellLocation();
  
  String networkOperator = telephonyManager.getNetworkOperator();
  int type = telephonyManager.getNetworkType();
  String mcc = networkOperator.substring(0, 3);
  String mnc = networkOperator.substring(3);
  textMCC.setText("mcc: " + mcc + " mnc: " + mnc);
  textMNC.setText("operator: " + networkOperator);
  
  int cid = cellLocation.getCid();
  int lac = cellLocation.getLac();
  int psc = cellLocation.getPsc();
  textGsmCellLocation.setText(cellLocation.toString());
  textCID.setText("lac: " + String.valueOf(lac) + " cid: " + String.valueOf(cid) + " psc: " + String.valueOf(psc) + " type: " + String.valueOf(type) + " rssi: " + String.valueOf(currentCellRSSI));
  
  TextView Neighboring = (TextView)findViewById(R.id.neighboring);
  List&lt;NeighboringCellInfo&gt; NeighboringList = telephonyManager.getNeighboringCellInfo();
  
  String stringNeighboring = "Neighboring List - Lac : Cid : Psc : type : RSSI\n";
  for(int i = 0; i &lt; NeighboringList.size(); i++)
  {
    String dBm;
    int rssi = NeighboringList.get(i).getRssi();
    if(rssi == NeighboringCellInfo.UNKNOWN_RSSI)
    {
      dBm = "Unknown RSSI";
    }
    else
    {
      if(rssi &gt;= 0 &amp;&amp; rssi &lt; 32)
      {
        dBm = String.valueOf(-113 + 2 * rssi) + " dBm";
      }
      else
      {
        dBm = "Unknown value:" + Integer.toString(rssi);
      }
    }
  
    stringNeighboring = stringNeighboring
      + String.valueOf(NeighboringList.get(i).getLac()) + " : "
      + String.valueOf(NeighboringList.get(i).getCid()) + " : "
      + String.valueOf(NeighboringList.get(i).getPsc()) + " : "
      + String.valueOf(NeighboringList.get(i).getNetworkType()) + " : "
      + dBm + "\n";
  }
  
  Neighboring.setText(stringNeighboring);
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/CWXzq.png" alt="enter image description here"></p>