使用Android Samsung Galaxy智能手机获取邻近细胞信息 [英] Getting neighboring cells information using android Samsung galaxy smartphones

查看:109
本文介绍了使用Android Samsung Galaxy智能手机获取邻近细胞信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的目标是获取所有相邻小区信号塔信息,例如小区ID,小区lac和RSS值,我使用了 telephonyManager.getNeighboringCellInfo()类来获取所需信息,但是

My target is to get all neighboring cell towers information like cell id, cell lac and RSS values, I used the class telephonyManager.getNeighboringCellInfo() to get required information but it return null every time.

但是,我成功地使用 telephonyManager成功获取了最近的连接到移动设备(即服务小区)的单个手机信号塔信息.getCellLocation()

我试图解决此问题并搜索与之相关的所有事物,然后我们发现所有三星设备都无法支持 telephonyManager.getNeighboringCellInfo()类,它不适用于Samsung,但适用于HTC和LG设备。

I tried to fix this problem and searched on every thing related it, then we found that all samsung devices can not support telephonyManager.getNeighboringCellInfo() class and it does not apply on Samsung but its working on HTC and LG devices.

请参阅:
https://code.google.com / p / android / issues / detail?id = 24136

我需要将其应用在Samsung Android设备上并获取邻近单元的信息。谁能告诉我我该怎么做?

I need to apply it on Samsung Android devices and getting neighboring cells information. Can anyone tell me how I can do that?

单个单元格代码:

if (telephonyManager.getPhoneType() == TelephonyManager.PHONE_TYPE_GSM) {
            cellLocation = (GsmCellLocation)telephonyManager.getCellLocation();
            if(cellLocation!=null){
                int cell_ID = cellLocation.getCid();
                int cell_psc= cellLocation.getPsc();
                int cell_lac =cellLocation.getLac();
                cell_info.setText("Cell_ID: "+ String.valueOf(cell_ID) +"\n"+"Cell_psc: "+ String.valueOf(cell_psc)+"\n"+
                        "Cell_lac: " +String.valueOf(cell_lac)+"\n"+cellLocation.toString());

            }
        }

相邻小区代码:

List<NeighboringCellInfo> neighboringCellInfos = telephonyManager.getNeighboringCellInfo();
        for(NeighboringCellInfo neighboringCellInfo : neighboringCellInfos)
        {
            neighboringCellInfo.getCid();
            neighboringCellInfo.getLac();
            neighboringCellInfo.getPsc();
            neighboringCellInfo.getNetworkType();
            neighboringCellInfo.getRssi();

            neibouring_cell_information.add(neighboringCellInfo.getCid()+"\n"+ neighboringCellInfo.getRssi());

        }
        Toast.makeText(getApplicationContext(),neibouring_cell_information +"ok" , Toast.LENGTH_LONG).show();

所有添加的权限:

    <uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>


推荐答案

三星手机似乎不支持邻居显示。请检查此论坛:

It seems Samsung phones not supporting neighbor display. Please check this forum:

http://www.finetopix.com/showthread.php?30787-G-NetTrack-Android-OS-Netmonitor/page2

此应用程序的开发人员表示,三星芯片不支持用于显示邻居的命令。

The developer of this app said that samsung chips not supporting commands for display neighbors.

这篇关于使用Android Samsung Galaxy智能手机获取邻近细胞信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆