title: What exactly is CellInfo and how to use getAllCellInfo to get info just about one connectivity type?
body: <p><strong>GOAL:</strong> get info (signal strength) of a particular type of connectivity (the one I'm actually using).</p>
  
  <p><strong>PROBLEM:</strong> I'm not sure to understand exactly what does reperesent <code>CellInfo</code> and how to extract info from <code>getAllCellInfo</code></p>
  
  <p><strong>QUESTIONS:</strong></p>
  
  <p>1) From android developer website</p>
  
  <blockquote>
    <p><strong>CellInfo:</strong> Immutable cell information from a point in time.</p>
  </blockquote>
  
  <p>What does it mean?</p>
  
  <p>2) I want to understand if I'm using wcdma, umts, gsm or lte. I've found here a snippet of code using <strong>getAllCellInfo</strong> , below my adapted version to get the signal strength</p>
  
  <pre><code>  for (final CellInfo info : telephonyManager.getAllCellInfo()) {
  
              if (info instanceof CellInfoGsm) {
  
                  final CellSignalStrengthGsm gsm = ((CellInfoGsm) info).getCellSignalStrength();
                  if(gsm.getLevel() &gt;= localMaxSignalStrength)
                       localMaxSignalStrength = gsm.getLevel();
                  Toast.makeText(getApplicationContext(), "gsm rssi" + localMaxSignalStrength, Toast.LENGTH_LONG).show();
  
              } else if (info instanceof CellInfoWcdma) {
  
                  final CellSignalStrengthWcdma cdma = ((CellInfoWcdma) info).getCellSignalStrength();
                  if(cdma.getLevel() &gt;= localMaxSignalStrength)
                      localMaxSignalStrength = cdma.getLevel();
                  Toast.makeText(getApplicationContext(), "wcdma rssi" + localMaxSignalStrength, Toast.LENGTH_LONG).show();
  
              } else if (info instanceof CellInfoLte) {
  
                  final CellSignalStrengthLte lte = ((CellInfoLte) info).getCellSignalStrength();
                  if(lte.getLevel() &gt;= localMaxSignalStrength)
                      localMaxSignalStrength = lte.getLevel();
                  Toast.makeText(getApplicationContext(), "lte rssi" + localMaxSignalStrength, Toast.LENGTH_LONG).show();
  </code></pre>
  
  <p>Now from what I've read on Android developer website </p>
  
  <blockquote>
    <p><strong>getAllCellInfo()</strong> : Returns all observed cell information from all radios on the device
    including the primary and neighboring cells. Calling this method does
    not trigger a call to onCellInfoChanged(), or change the rate at which
    onCellInfoChanged() is called.</p>
    
    <p>The list can include <strong>one or more</strong> CellInfoGsm, CellInfoCdma,
    CellInfoLte, and CellInfoWcdma objects, in any combination.</p>
  </blockquote>
  
  <p>so it means that <code>getAllCellInfo()</code> doesn't return just one kind of connectivity info, but they can be mixed. 
  I want to understand if my phone is using all of the returned ones or just one of them (and in the latter case how to find which one I'm using).</p>