当我请求手机ID和LAC信息时,在某些设备上我无法检索它们。
我使用这个代码:

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

cellID = location.getCid();

lac = location.getLac();

有人知道为什么一些GSM运营商不提供它们吗?
我需要权限吗?
还有什么关于找回囚室和紫胶的事?

最佳答案

所以你可以试试。我有手机号码和GSM的位置区号。但是对于umts,getcid()为exple 33 166 248返回一个大数字。所以我添加了模运算符(exple xxx.getcid()%0xffff)。

GsmCellLocation cellLocation = (GsmCellLocation)telm.getCellLocation();

    new_cid = cellLocation.getCid() % 0xffff;
    new_lac = cellLocation.getLac() % 0xffff;

08-04 09:41