Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Handle NFC while phone is sleeping in Android

Tags:

android

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 ?

like image 645
roly Avatar asked Apr 21 '11 15:04

roly


People also ask

How do I keep my Android from going to sleep?

Enable stay awake modeFrom the settings page navigate to > About Tablet > Software Information. Then tap the "Build Number" 7 times to enable developer mode. Developers mode is where you'll find the Stay Awake option, toggle to enable.


2 Answers

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.

like image 96
shihpeng Avatar answered Oct 22 '22 15:10

shihpeng


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

like image 1
Maximus Avatar answered Oct 22 '22 15:10

Maximus