I have an Android app that reads NFC tags. Everything works fine on the LG Nexus 4, but on the Samsung Galaxy S5 I only get I / O exceptions (tested on multiple phones).
So, the tags are of type NfcV, and I get an I / O exception when calling connect() on NfcV (further down, this is error code -5 ERROR_CONNECT).
NFC TagInfo by NXP can read the contents of tag memory on SG5S - are there any other ways to read NfcV tags than with connect() and transceive() ?
What differences between NFC chips will lead to the fact that the connection to my application will not work on one phone, but not on another (while other applications read it correctly)? Are there any time intervals that I need to adjust, maybe?
Code snippet:
NfcV nfcvTag = NfcV.get(intent.getParcelableExtra(NfcAdapter.EXTRA_TAG)); if(nfcvTag!=null){ try { nfcvTag.connect(); //{flags:0x00, read multiple blocks command: 0x23, start at block 0: 0x00, read 9 blocks (0 to 8): 0x08} response = nfcvTag.transceive(new byte[] {(byte)0x00,(byte)0x23,(byte)0x00,byte)0x08}); } catch (IOException e) { Log.d("NFCService", nfcvTag.toString()); } finally { try { nfcvTag.close(); } catch (IOException e) { } } }
source share