LG-P500 上的 SIM 状态检测问题
我的应用程序需要在执行操作之前检查 SIM 卡状态。因此,我使用 TelephonyManager.getSimState () 。如果应用程序将状态视为 SIM_STATE_READY,则它将继续,否则向用户显示错误。 到目前为止,此方法运行良好,但最近我收到 LG-P500 (LG Optimus One) 设备所有者的投诉,称尽管用户已将 SIM 卡插入设备并且能够拨打/接听电话,但我的应用程序不断给出有关 SIM 卡的错误。
来自用户的日志显示,在设备上我得到的 sim 状态为 SIM_STATE_UNKNOWN (0) 。
OS Version :2.3.3
Brand :lge
Device :thunderg
LG 是否以不同的方式管理 Sim 状态,或者 LG 以某种方式将 SIM_STATE_UNKNOWN 和 SIM_STATE_READY 视为相同?
谢谢,
图沙尔
My app needs to check SIM card status before performing an action. So for that I use the TelephonyManager.getSimState () . If app see state as SIM_STATE_READY then it proceeds else show error to the user.
This so far has worked well, but recently I got complains from LG-P500 (LG Optimus One ) device owners saying that although user has SIM card inserted in device and is able to make/receive calls my application keeps giving error about SIM card.
Logs from user shows that on device I get sim state as SIM_STATE_UNKNOWN (0) .
OS Version :2.3.3
Brand :lge
Device :thunderg
Is LG any way managing Sim state differently or LG somehow treats SIM_STATE_UNKNOWN and SIM_STATE_READY same ?
Thanks,
Tushar
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从 2.3 开始,我只使用 LG P500 遇到同样的问题,在 2.2 上工作正常。
要检测 SIM 是否准备就绪,您可以使用
`TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
String imsi = tm.getSubscriberId();`
如果 imsi 不为 null,则 SIM 已准备就绪。
PhoneStateListener 在 LG P500 上也可以使用,您可以使用它。
I have the same problem with only LG P500 since 2.3, on 2.2 works fine.
To detect if SIM ready you can use
`TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
String imsi = tm.getSubscriberId();`
if imsi is not null SIM is ready.
Also on LG P500 works PhoneStateListener and you can use it.
医生说
SIM_STATE_READY 不等于 SIM_STATE_UNKNOW
显示未知的原因可能有很多。此外,它很可能位于 CDMA 网络中,因此可能没有 SIM 卡或无法访问它。
The doc says
SIM_STATE_READY is not equal to SIM_STATE_UNKNOW
Reason for showing unknown could be many. Also, chances are that it is in CDMA network hence might not have SIM or Access to it.