简体   繁体   English

如何在星系连接上显示所有可用的单元格(4.3)

[英]How to display all available cells on a galaxy nexus (4.3)

My employer gave me a femto-cell and currently i am trying to figure if my galaxy-nexus can access the femtocell. 我的雇主给了我一个femto-cell ,目前我正在试图判断我的galaxy-nexus是否可以访问femtocell。 As i cant force my phone to use this specific cell and it automatically always uses just available macro-cells, i have trouble to figure if the femtocell is present at all. 因为我不能强迫我的手机使用这个特定的小区,并且它自动总是只使用可用的宏小区,我很难确定是否存在毫微微小区。

Here is what i tried so far. 这是我到目前为止所尝试的。 But it always returns null , which means in android-docs that my device isnt capable of using CellInfo-methods. 但它总是返回null ,这意味着在android-docs中我的设备不能使用CellInfo方法。

telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
List<CellInfo> cellInfo = telephonyManager.getAllCellInfo();  // returns null
List<NeighboringCellInfo> cellInfo = telephonyManager.getNeighboringCellInfo(); // returns null

then 然后

 telephonyManager.getPhoneType(); // returns PHONE_TYPE_GSM

aswell i found this quote in another post: 我还在另一篇文章中找到了这句话:

Conclusion: getting information about nearby cells on Android is pretty messy business at the moment. 结论:在Android上获取有关附近单元格的信息是非常混乱的。 You may need to use a combination of all three methods to get the information you want, and even that way, some things may be inaccessible. 您可能需要使用所有三种方法的组合来获取所需的信息,即使这样,某些事情也可能无法访问。

What might be the third option? 可能是第三种选择? Does anyone have a conclusion for a galaxy nexus? 有没有人得出星系纽带的结论? Does anyone have another idea how i could detect the availabilty of the femto_cell? 有没有人知道如何检测femto_cell的可用性? it is driving me mad :/ 它让我发疯:/

Especially on older phones getAllCellInfo() is not always supported. 特别是在较旧的手机上,并不总是支持getAllCellInfo()。 Try to use the old methods for retrieving cell information of the connected base station: 尝试使用旧方法检索连接基站的小区信息:

TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
GsmCellLocation cellLocation = (GsmCellLocation) telephonyManager.getCellLocation();
int cellid = cellLocation.getCid();
...

Unfortunately, there is no way to get the neighboring cells on a Samsung device. 不幸的是,没有办法让三星设备上的相邻小区。 In my experience you get best results (and working getAllCellInfo()) with current LG phones. 根据我的经验,您可以使用当前的LG手机获得最佳效果(以及使用getAllCellInfo())。

Use CellLocation to find the cell id(base station ID). 使用CellLocation查找单元ID(基站ID)。

Try something like this 尝试这样的事情

TelephonyManager tm = (TelephonyManager) getSystemService(TELEPHONY_SERVICE);
CellLocation cl = tm.getCellLocation();
GsmCellLocation gsmLoc;
CdmaCellLocation cdmaLoc;
try {
    gsmLoc = (GsmCellLocation) cl;
    System.out.println("Cell id " + gsmLoc.getCid());
    System.out.println("Lac - " + gsmLoc.getLac());
    System.out.println("Psc - " + gsmLoc.getPsc());
} catch (ClassCastException e) {
    cdmaLoc = (CdmaCellLocation) cl;
    System.out.println("Base station ID - "+ cdmaLoc.getBaseStationId());
    System.out.println("Base station Latitude - "+ cdmaLoc.getBaseStationLatitude());
    System.out.println("Network Id - "+ cdmaLoc.getNetworkId());
    System.out.println("System ID -"+ cdmaLoc.getSystemId());
}
System.out.println("Operator Name - "+ tm.getNetworkOperatorName());

I tested using Verizon's network extender and the operator name returned is "Network Extender". 我使用Verizon的网络扩展器进行了测试,返回的运营商名称是“Network Extender”。

I used Samsung Note 3. A "home" icon displayed on the status bar When connected to femto cell. 我使用了Samsung Note 3.状态栏上显示的“home”图标连接到femto cell时。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM