Android 中手机休眠时处理 NFC
我想知道手机休眠时是否可以处理 NFC? 似乎没有启动任何意图,所以我想系统会关闭 NFC ?
I'd like to know if it's possible to handle NFC while the phone is sleeping ?
It seems that no intent is launched so I imagine that the system turns off the nfc ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
不会。设备显示屏关闭时不会生成和发送意图。如果您有 Nexus S,请尝试标记某些内容并观察目录,您会发现手机上没有收到任何内容。
我认为这种行为是非常合理的。由于现在我们周围的很多东西都内置了RFID标签,如果即使在屏幕关闭的情况下也能触发NFC应用程序,可能会发生意想不到的事情。
No. The intent won't be generated and sent while the device's display is off. If you have Nexus S, try to tag something and observe catlog, you'll find nothing received on the phone.
I think this behavior is very reasonable. Since today so many things around us have RFID tag within, if the NFC apps can be triggered even when the screen is off, something unexpected may happen.
NFC 是相当新的……但据我所知,当手机处于“深度睡眠”状态时,唯一会运行的东西是来自 AlarmManager 的警报以及来电和短信。
引用 CommonsWare 名声的 Mark Murphy...
“唯一可以信赖的不间断功能是 GSM 或 CDMA 无线电(用于来电、短信和 IP 数据包)和 AlarmManager”
Android 睡眠/待机模式
NFC is fairly new... but to my knowledge, about the only things that will run while a phone is in "deep sleep" are Alarms from the AlarmManager and incoming Phone Calls and text messages.
Quoting Mark Murphy of CommonsWare fame...
"About the only thing you can count on not stopping is the GSM or CDMA radio (for incoming calls, SMSes, and IP packets) and AlarmManager"
Android Sleep/Standby Mode
如果您能够对手机进行修改,您可能会发现此模组已发布到 XDA 将使 NFC 在手机处于睡眠状态时工作(免责声明:我还没有机会测试它是否真正工作)。
If you are able to make modifications to your phone, you may find this mod posted to XDA will enable NFC to work while the phone is in sleep state (disclaimer: I have not yet had a chance to test that it actually works).