我是靠谱客的博主 友好薯片,这篇文章主要介绍Android获取5G信息,现在分享给大家,希望可以做个参考。

Android在NR情况下获取5G的rsrp,rsrq和ssnr,pci和ci值。

TelephonyManager tm = (TelephonyManager) getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE);
List<CellInfo> allCellInfo = tm.getAllCellInfo();
        if (allCellInfo != null && allCellInfo.size() > 0) {
            for (int i = 0; i < allCellInfo.size(); i++) {
                CellInfo info = allCellInfo.get(i);
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
                    //5G
                    if (info instanceof CellInfoNr) {
                        CellIdentityNr nr = (CellIdentityNr) ((CellInfoNr) info).getCellIdentity();
                        int pci = nr.getPci();
                        long ci = nr.getNci();
                        CellSignalStrengthNr nrStrength = (CellSignalStrengthNr) ((CellInfoNr) info).getCellSignalStrengt
                        now_rsrp = "-" + nrStrength.getSsRsrp() + "";
                        String s = ((CellInfoNr)CellInfoNr info).toString();

                    }
                }
            }
         
        }

最后

以上就是友好薯片最近收集整理的关于Android获取5G信息的全部内容,更多相关Android获取5G信息内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(67)

评论列表共有 0 条评论

立即
投稿
返回
顶部