开发者

Handle NFC while phone is sleeping in Android

开发者 https://www.devze.com 2023-02-27 09:48 出处:网络
I\'d like to know if it\'s p开发者_如何学Pythonossible to handle NFC while the phone is sleeping ?

I'd like to know if it's p开发者_如何学Pythonossible 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 ?


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 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


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).

0

精彩评论

暂无评论...
验证码 换一张
取 消