nfc

Android NfcV get information command returns only one byte

回眸只為那壹抹淺笑 提交于 2020-01-04 13:40:16
问题 I'm writing an app for reading binary infos of NFC tags. Here's the code of the NFC intent handler function: protected void onNewIntent(@NonNull Intent intent) { try { Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG); NfcV nfcV = NfcV.get(tag); byte[] cmdInfo = new byte[]{(byte) 0x02, (byte) 0x2b}; // 'Get info' command byte[] answer = nfcV.transceive(cmdInfo); // Read info from tag. ... } catch(IOException e) { ... } } If I run this function reading an NFC tag on a Samsung S3 Neo

Android NfcV get information command returns only one byte

最后都变了- 提交于 2020-01-04 13:39:28
问题 I'm writing an app for reading binary infos of NFC tags. Here's the code of the NFC intent handler function: protected void onNewIntent(@NonNull Intent intent) { try { Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG); NfcV nfcV = NfcV.get(tag); byte[] cmdInfo = new byte[]{(byte) 0x02, (byte) 0x2b}; // 'Get info' command byte[] answer = nfcV.transceive(cmdInfo); // Read info from tag. ... } catch(IOException e) { ... } } If I run this function reading an NFC tag on a Samsung S3 Neo

javax.smartcardio transmit to NFC USB reader without card

一个人想着一个人 提交于 2020-01-04 04:13:08
问题 Is it possible to send APDU to the NFC reader (for example ACR1222L) using javax.smartcardio without actual card "connected" ? As per my API investigation, you can send APDU only using CardChannel which you get from Card and that you get from connect on CardTerminal. However, if you try to connect when no card in NFC reader, you get CardException. On some readers, peripherals are controlled using standard APDUs. This way it seems you cannot control any peripheral of the ACR1222 prior card is

Disable Android Beam for selected activities

我们两清 提交于 2020-01-02 17:15:09
问题 I'm working with NFC on Android, specifically with Android Beam. My question is: is it possible to disable Android Beam support for an activity? This is what some system applications do, such as messaging: if another phone is put close, my phone vibrates but the "Touch to beam" screen doesn't appear and the other phone doesn't receive anything. EDIT: Calling: NfcAdapter.setNdefPushMessage(NdefMessage message, Activity activity, Activity... activities) in onResume() with a null message should

How to write MifareClassic with Custom Key

佐手、 提交于 2020-01-02 16:02:56
问题 I need to find a solution to write Mifare Classic 1 K Tag with Custom Key. I am unable to write it, I have tried with every option but unfortunately all the time I get the error "IOException: Transceive Failed". Below is my code snippet: byte custom_key[]={ (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff }; // 16 bytes of Data. Otherwise it was throwing IllegalArgumentException . byte[] data="Hello world of N".getBytes(); getMfc().connect(); if(getMfc()

How to write MifareClassic with Custom Key

試著忘記壹切 提交于 2020-01-02 16:02:04
问题 I need to find a solution to write Mifare Classic 1 K Tag with Custom Key. I am unable to write it, I have tried with every option but unfortunately all the time I get the error "IOException: Transceive Failed". Below is my code snippet: byte custom_key[]={ (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff }; // 16 bytes of Data. Otherwise it was throwing IllegalArgumentException . byte[] data="Hello world of N".getBytes(); getMfc().connect(); if(getMfc()

Hide NFC app from “Choose Application” list / Disable start by external NFC intent

折月煮酒 提交于 2020-01-02 15:26:24
问题 I'm currently writing a couple of NFC enabled apps for Android and wanted to know how I can stop my application from being in the "choose application" list that's opened whenever a tag is scanned from the launcher or a non-NFC app. I only want my apps to be able to read the tags when they are open. My current intent filters: <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> <intent-filter> <action

Initial handshake between NFC controller and POS reader

旧街凉风 提交于 2020-01-02 14:59:02
问题 I have few questions when the reader initiates the transaction with NFC emulated payment application using HCE Does the reader send the PPSE command as with the regular contactless card infrastructure? Does the host controller respond to PPSE command with the list of AID's from the registered AIDs listed in the routing table? So after the reader selects the AID, the host controller directs to the right HCE service? Please correct my understanding on the above concept. 回答1: An EMV payment card

Initial handshake between NFC controller and POS reader

六月ゝ 毕业季﹏ 提交于 2020-01-02 14:58:15
问题 I have few questions when the reader initiates the transaction with NFC emulated payment application using HCE Does the reader send the PPSE command as with the regular contactless card infrastructure? Does the host controller respond to PPSE command with the list of AID's from the registered AIDs listed in the routing table? So after the reader selects the AID, the host controller directs to the right HCE service? Please correct my understanding on the above concept. 回答1: An EMV payment card

NFC card emulation with closed reader application

给你一囗甜甜゛ 提交于 2020-01-02 14:39:53
问题 I have two apps on two Android devices, similar to CardEmulation and CardReader from the samples for NFC. I want to send data from the host card emulation app running on one Android device to the reader application running on the second Android device. This works when both apps are open in foreground. But if I close the reader application, I can no longer send data to it. Instead, when the two phones are held together, they activate Beam transmission. However, I would like to have the reader