1
A
回答
1
我明白了!
final CellIdentityLte identityLte = ((CellInfoLte) info).getCellIdentity();
int longCid = identityLte.getCi();
String cellidHex = DecToHex(longCid);
String eNBHex = cellidHex.substring(0, cellidHex.length()-2);
int eNB = HexToDec(eNBHex);
return checkValidString(Integer.toString(eNB));
使用此方法...
// Decimal -> hexadecimal
public String DecToHex(int dec){
return String.format("%x", dec);
}
// hex -> decimal
public int HexToDec(String hex){
return Integer.parseInt(hex, 16);
}
-1
只需使用:
identityLte.getCi() >> 8
+0
這不提供問題的答案。一旦你有足夠的[聲譽](https://stackoverflow.com/help/whats-reputation),你將可以[對任何帖子發表評論](https://stackoverflow.com/help/privileges/comment);相反,[提供不需要提問者澄清的答案](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can- I-DO-代替)。 - [來自評論](/ review/low-quality-posts/16855816) –
相關問題
- 1. 如何在Android上獲取父ID?
- 2. 如何在android中獲取LTE小區位置?
- 3. 的Android TelephonyManager
- 4. 如何從Android Studio的XAMPP數據庫獲取用戶ID
- 5. Android 2.3.4 TelephonyManager
- 6. 如何在android中獲取廣告ID?
- 7. 如何在Android中獲取設備ID?
- 8. 使用telephonymanager獲取sim序列號
- 9. 在Android上獲取OpenFeint播放器ID
- 10. 如何在Facebook上獲取應用ID
- 11. Android在AutoCompleteTextView中獲取Id的值Id
- 12. 在Android Studio上添加新的ID
- 13. 在Android Studio中獲取android.database.sqlite.SQLiteException
- 14. 獲取信號強度的LTE參數
- 15. 獲得EMEI與TelephonyManager
- 16. 獲取主ID上點擊Android的
- 17. 的Android TelephonyManager「答案」事件
- 18. 如何在IE中通過ID獲取元素? (Visual Studio的8?)
- 19. 如何在Android上獲取PreferenceActivity的FragmentManager?
- 20. 如何在Android Studio中獲取我的Android指紋驗證碼
- 21. 如何在使用Android Studio時獲取Android庫的源代碼?
- 22. 如何獲取Android聯繫人列表上聯繫人的ID?
- 23. Android:如何在Android中獲取兩張SIM卡的SIM卡ID?
- 24. 如何獲取Android手機的收音機類型(GSM,CDMA,WCDMA,LTE)
- 25. 使用TelephonyManager獲取SIM國家代碼 - 如何?
- 26. 如何從Android Studio獲取Instrumentation APK?
- 27. 如何獲取Android應用程序ID?
- 28. 如何獲取Android線程ID?
- 29. 如何獲取android設備唯一ID?
- 30. 如何獲取android設備ID?
正是我一直在尋找的。我測試了它,這是真的。 getCi()的輸出轉換爲HEX,最後兩個符號爲本地小區ID的HEX值,其餘爲eNodeB ID的HEX值。例如,轉換爲HEX的1046022是FF606。 eNodeB爲FF6 - > 4086,本地小區ID爲06 - > 6.完全按照我連接的LTE小區配置。 – vladiz