2

I am developing an nfc application for Android and would like to deal with a tag that can support either NFC-V or NFC-A protocol.

The problem is that when I approach the tag with my phone (Galaxy S2 plus, running android 4.1.2) it detects the NFC-V protocol 90% of the time, and the NFC-A protocol 10% of the time.

What I would like to do is force my phone to only pay attention to one of the two protocols. This mean I would like to configure my phone before touching the tag to only listen to the NFC-V protocol for example.

Is this possible?

Michael Roland
  • 39,663
  • 10
  • 99
  • 206
Jinbonka
  • 123
  • 1
  • 11

2 Answers2

1

This is unfortunately not possible.

The NFC hardware time-multiplexes all the different protocols. If you put your tag near the antenna, and the NFC-chip is currently sensing for for NFC-V you will get NFC-V. Same with NFC-A.

Nils Pipenbrinck
  • 83,631
  • 31
  • 151
  • 221
  • hmm, I was afraid of that. Would it be possible once the Nfc-V protocol has been sensed to switch to the Nfc-A protocol without disconnecting the tag ? I know i can switch the tag to Nfc-A via a command but will my device be able to do the same ? – Jinbonka Apr 15 '13 at 08:13
  • If you switch from NfcV to NfcA using a special NfcV command you will lose the connection to the tag but will rediscover the tag in NfcA mode within a second or so. – Nils Pipenbrinck Apr 16 '13 at 06:49
0

Since Android 4.4 this is possible using the Android NFC reader-mode API:

NfcAdapter nfcAdapter = NfcAdapter.getDefaultAdapter(this);
nfcAdapter.enableReaderMode(this, this, NfcAdapter.FLAG_READER_NFC_V, null);

You could then retrieve the Tag object through the reader-callback:

public void onTagDiscovered (Tag tag) {
    ...
}
Michael Roland
  • 39,663
  • 10
  • 99
  • 206