Android:无法获取LTECellId”
创始人
2024-10-13 21:00:52
0

在Android设备上,通过TelephonyManager类获取CellId对于LTE网络存在一些问题。因为LTE网络使用了多个单元,所以需要使用不同的方法来获取CellId。以下是一个获取LTE CellId的示例代码:

public int getLteCellId(TelephonyManager telephonyManager) {
    int lteCellId = Integer.MAX_VALUE;
    try {
        final Class telephonyManagerClass = Class.forName(telephonyManager.getClass().getName());
        final Method getCellLocationMethod = telephonyManagerClass.getDeclaredMethod("getAllCellInfo");
        final List cellInfoList = (List) getCellLocationMethod.invoke(telephonyManager);
        for (CellInfo cellInfo : cellInfoList) {
            if (cellInfo instanceof CellInfoLte) {
                final CellIdentityLte cellIdentityLte = ((CellInfoLte) cellInfo).getCellIdentity();
                lteCellId = cellIdentityLte.getCi();
            }
        }
    } catch (Exception e) {  
        e.printStackTrace();
    }
    return lteCellId;
}

相关内容

热门资讯

第五分钟方针!wepoker正... 第五分钟方针!wepoker正确养号方法(透视)确实存在有辅助透视(哔哩哔哩)1、wepoker正确...
9分钟指引!黑侠破解wepok... 9分钟指引!黑侠破解wepoker(透视)一贯真的是有辅助脚本(哔哩哔哩)黑侠破解wepoker辅助...
六分钟教材!hhpoker是内... 六分钟教材!hhpoker是内部控制吗(透视)确实存在有辅助工具(哔哩哔哩)1、玩家可以在hhpok...
四分钟手册!we poker游... 四分钟手册!we poker游戏下(透视)确实是真的有辅助教程(哔哩哔哩)1)we poker游戏下...
第5分钟大纲!hardrock... 第5分钟大纲!hardrock作必弊(透视)一贯存在有辅助安装(哔哩哔哩)1、hardrock作必弊...
1分钟窍门!wepokerpl... 1分钟窍门!wepokerplus脚本(透视)都是真的有辅助辅助(哔哩哔哩)1、操作简单,无需wep...
第二分钟练习!德普之星app安... 第二分钟练习!德普之星app安卓版破解版(透视)原来是有辅助教程(哔哩哔哩)进入游戏-大厅左侧-新手...
第五分钟妙计!wepoker科... 第五分钟妙计!wepoker科技辅助器(透视)确实有辅助神器(哔哩哔哩)1、进入游戏-大厅左侧-新手...
7分钟模板!德州私人局怎么透视... 7分钟模板!德州私人局怎么透视(透视)都是真的是有辅助下载(哔哩哔哩)德州私人局怎么透视脚本下载中分...
第四分钟学习!hhpoker作... 第四分钟学习!hhpoker作必弊实战视频(透视)本来真的是有辅助下载(哔哩哔哩)1、金币登录送、破...