获取周围基站的信息 getNeighboringCellInfo

本文介绍了一种通过Android系统的TelephonyManager获取周边基站信息的方法,并展示了如何读取邻居小区的CID、LAC及信号强度。

转http://blog.youkuaiyun.com/wzsong123/article/details/6741973



public List<NeighboringCellInfogetNeighboringCellInfo ()
Since:  API Level 3

Returns the neighboring cell information of the device.

Returns
  • List of NeighboringCellInfo or null if info unavailable.

    Requires Permission: (@link Android.Manifest.permission#ACCESS_COARSE_UPDATES}


获取当前连接的基站信息的到处都是,下面只写我获取周围基站的过程:

tm = (TelephonyManager) this
                .getSystemService(Context.TELEPHONY_SERVICE);

List<NeighboringCellInfo> list = tm.getNeighboringCellInfo();

if (!list.isEmpty()) {
            for (NeighboringCellInfo info : list) {

                int cid = info.getCid();
                // 获取邻居小区LAC,LAC:
                // 位置区域码。为了确定移动台的位置,每个GSM/PLMN的覆盖区都被划分成许多位置区,LAC则用于标识不同的位置区。
                int lac = info.getLac();
               
                // 获取邻居小区信号强度
                int ss = -131 + 2 * info.getRssi();
                
            }
 }

不出意外的话,以上就OK了。


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值