簡體   English   中英

如何在星系連接上顯示所有可用的單元格(4.3)

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

我的雇主給了我一個femto-cell ,目前我正在試圖判斷我的galaxy-nexus是否可以訪問femtocell。 因為我不能強迫我的手機使用這個特定的小區,並且它自動總是只使用可用的宏小區,我很難確定是否存在毫微微小區。

這是我到目前為止所嘗試的。 但它總是返回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

然后

 telephonyManager.getPhoneType(); // returns PHONE_TYPE_GSM

我還在另一篇文章中找到了這句話:

結論:在Android上獲取有關附近單元格的信息是非常混亂的。 您可能需要使用所有三種方法的組合來獲取所需的信息,即使這樣,某些事情也可能無法訪問。

可能是第三種選擇? 有沒有人得出星系紐帶的結論? 有沒有人知道如何檢測femto_cell的可用性? 它讓我發瘋:/

特別是在較舊的手機上,並不總是支持getAllCellInfo()。 嘗試使用舊方法檢索連接基站的小區信息:

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

不幸的是,沒有辦法讓三星設備上的相鄰小區。 根據我的經驗,您可以使用當前的LG手機獲得最佳效果(以及使用getAllCellInfo())。

使用CellLocation查找單元ID(基站ID)。

嘗試這樣的事情

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());

我使用Verizon的網絡擴展器進行了測試,返回的運營商名稱是“Network Extender”。

我使用了Samsung Note 3.狀態欄上顯示的“home”圖標連接到femto cell時。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM