use*_*779 3 gps android cellid
当我请求Cell ID和LAC信息时,在某些设备上我无法检索它们.
我用这个代码:
TelephonyManager tm =(TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
location = (GsmCellLocation) tm.getCellLocation();
cellID = location.getCid();
lac = location.getLac();
Run Code Online (Sandbox Code Playgroud)
小智 18
为了找到CellId,你应该使用0xffff作为位掩码,而不是mod.
错误
new_cid = cellLocation.getCid() % 0xffff;
Run Code Online (Sandbox Code Playgroud)
对
new_cid = cellLocation.getCid() & 0xffff;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4341 次 |
| 最近记录: |