android TelephonyManager 是否缓冲 GSMCellILocation?
我遇到过这样的情况:即使手机中没有 SIM 卡,我也观察到 Android 的 TelephonyManager 正在为我提供位置区域代码和小区 ID。
cellLocation = (GsmCellLocation) mTMInstance.getCellLocation();
if(cellLocation == null)
return false;
currentCellID = ((GsmCellLocation)cellLocation).getCid();
currentLac = ((GsmCellLocation)cellLocation).getLac();
currentImsi = mTMInstance.getSubscriberId();
有人可以确认您是否遇到过类似的问题吗?我已经在 froyo 上编译并在 Gingerbread 上运行该应用程序。
I have been facing a scenario where I have observed that Android's TelephonyManager is providing me location area code and cell ID even if there is no SIM card in the phone.
cellLocation = (GsmCellLocation) mTMInstance.getCellLocation();
if(cellLocation == null)
return false;
currentCellID = ((GsmCellLocation)cellLocation).getCid();
currentLac = ((GsmCellLocation)cellLocation).getLac();
currentImsi = mTMInstance.getSubscriberId();
Could someone confirm if you have faced similar issue? I have compiled on froyo and am running the app on Gingerbread.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过一些观察,我得出的结论是,即使 SIM 卡不可用,Android(和黑莓)也可以提供网络详细信息。原因是手机内置了 GSM 无线电,不需要 SIM 来检测网络,而只需选择其中一个网络。
Post a few observations, I have concluded that Android (and Blackberry) can provide the network details even if a SIM is not available. The reason for this is that gsm radio is built into the phone which doesn't need a SIM to detect networks, but only to select one of them.