Page 1 of 1

how to detect disconnection from NFC

Posted: 16 Feb 2017 12:57
by nantzen
well, I know there is a trigger to detect if you are connected to a NFC tag (with a certain ID number) and I use this trigger to activate some action. But I didn't see a trigger that tell me that I am no more connected with the NFC tag (with a certain ID number) so that I can deactivate the previous action. Can someone help me?

Re: how to detect disconnection from NFC

Posted: 16 Feb 2017 16:36
by Scotty
nantzen wrote:well, I know there is a trigger to detect if you are connected to a NFC tag (with a certain ID number) and I use this trigger to activate some action. But I didn't see a trigger that tell me that I am no more connected with the NFC tag (with a certain ID number) so that I can deactivate the previous action. Can someone help me?
I think it's theoretically possible, in Android, to detect the absence of (or loss of proximity to) an NFC tag but, to the best of my knowledge, you can't do this in Automagic. As you said, AM can detect (and respond to) proximity to a tag, but I don't think there is an easy way to (for example) poll every so often to see if you are still close to it.

If I'm incorrect, I am sure someone more knowledgeable than I will post a more helpful response.

Re: how to detect disconnection from NFC

Posted: 16 Feb 2017 16:41
by Martin
Hi,

Unfortunately regular Android ROMs don't send an event when a tag is lost/removed. Please also check this post for an Xposed module:
http://automagic4android.com/forum/view ... 701&p=5118

This post could also be interesting:
http://automagic4android.com/forum/view ... 902&p=2545

Regards,
Martin