gpt4 book ai didi

Android:并非所有运营商都提供 CellID?

转载 作者:太空宇宙 更新时间:2023-11-03 11:30:23 24 4
gpt4 key购买 nike

当我请求 Cell ID 和 LAC 信息时,在某些设备上我无法检索它们。

我使用这段代码:

TelephonyManager tm =(TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
location = (GsmCellLocation) tm.getCellLocation();

cellID = location.getCid();

lac = location.getLac();
  1. 有谁知道为什么有些 GSM 运营商不提供它们?
  2. 我需要权限吗?
  3. 关于检索 CellID 和 LAC,还有什么需要了解的?

最佳答案

为了找到 CellId,您应该使用 0xffff 作为位掩码,而不是 mod。

错误

new_cid = cellLocation.getCid() % 0xffff;

new_cid = cellLocation.getCid() & 0xffff;

关于Android:并非所有运营商都提供 CellID?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9808396/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com