我最近正在开发一个 android 项目,我需要获取 CELL Id 和 LAC(位置区号),并且我在我的设备中运行它我得到的值大于 CELL Id 的0xffff
默认最大值
为什么会这样?3G和2G有区别吗?
这是我的代码
TextView msg = (TextView)findViewById(R.id.textView2);
final TelephonyManager telephony = (TelephonyManager)
getSystemService(Context.TELEPHONY_SERVICE);
if (telephony.getPhoneType() == TelephonyManager.PHONE_TYPE_GSM) {
final GsmCellLocation location = (GsmCellLocation) telephony.getCellLocation();
if (location != null) {
msg.setText("LAC: " + location.getLac() + " CID: " + location.getCid());
}
}