Hi JarvanZhang-MSFT, I have been trying to get various parameters from the LTE network but I see that the AllcellInfo property returns a collection with zero elements. I only get general values such as IMEI, ASU, network etc.
I comment that I add the location permissions and that the minimum Android version and destination in the Manifest are API 22 (Android 5.1)
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCEPT_HANDOVER" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION
CODE (IDE VS / Xamarin.Essentials):
private void _CellInfoButton_Click(object sender, EventArgs e)
{
_cellSignalStrengthListener2 = new CellSignalStrengthListener(this);
TelephonyManager _telephonyManager2 = (TelephonyManager)this.GetSystemService(Context.TelephonyService);
//_telephonyManager2.Listen(_cellSignalStrengthListener2, PhoneStateListenerFlags.CellInfo);
var list = _telephonyManager2.AllCellInfo; // list with 0 elements!!
Ckpi cellDataEntity = new Ckpi();
if (list != null)
{
_CoberturaTextView.Text = string.Format("Cubrimiento: {0}", list.Count); // 0 elements!!
foreach (var item in list)
{
if (item.GetType() == typeof(CellInfoLte))
{
cellDataEntity.Cobertura = ((CellInfoLte)item).CellSignalStrength.Rsrp;
cellDataEntity.Calidad = ((CellInfoLte)item).CellSignalStrength.Rsrq;
cellDataEntity.Señal_ruido = ((CellInfoLte)item).CellSignalStrength.Rssnr;
cellDataEntity.Calidad_celda = ((CellInfoLte)item).CellSignalStrength.Cqi;
cellDataEntity.Ancho_banda = ((CellInfoLte)item).CellIdentity.Bandwidth;
cellDataEntity.Cid = ((CellInfoLte)item).CellIdentity.Ci;
cellDataEntity.Canal = ((CellInfoLte)item).CellIdentity.Earfcn;
cellDataEntity.Mcc = ((CellInfoLte)item).CellIdentity.MccString;
cellDataEntity.Mnc = ((CellInfoLte)item).CellIdentity.MncString;
cellDataEntity.Pci = ((CellInfoLte)item).CellIdentity.Pci;
cellDataEntity.Tac = ((CellInfoLte)item).CellIdentity.Tac;
_CoberturaTextView.Text = string.Format("Cubrimiento: {0}", cellDataEntity.Cobertura); // nothing!!
}
}
}
}