hce

How can I send message from HostApduService to an activity? [closed]

て烟熏妆下的殇ゞ 提交于 2019-12-01 20:23:09
I would like to pass a string to an Activity easily. Something like callback would be needed because when the string has to be passed then the Activity has to do something. public class MyHostApduService extends HostApduService { @Override public byte[] processCommandApdu(byte[] apdu, Bundle extras) { if (selectAidApdu(apdu)) { Log.i("HCEDEMO", "Application selected"); return getWelcomeMessage(); } else { if (exchangeDataApdu(apdu)) { Log.i("HCEDEMO", "Data exchanged"); // int _len_ = apdu[4]; String _data_ = new String(apdu).substring(5, apdu.length - 1); // TODO: Send _data_ to an activity..

Writing data into Nexus 4 in card emulation mode with ACR122

大兔子大兔子 提交于 2019-12-01 14:49:09
I am trying to send some data to the Nexus 4 through NFC (i.e. the card emulation mode). I tried a number of the command APDUs such as writing and updating APDUs, but I couldn't get them to work. What I am trying to say is, I want to send some data (that is not the AID) to the phone after the select APDU command. Thanks in advance, Bader The HCE emulated card will understand exactly those commands that your HCE app's APDU service processes. So, for instance, if your HCE service's processCommandApdu() callback method looks like this: final static byte[] SW_NO_ERROR = new byte[]{ (byte)0x90,

Writing data into Nexus 4 in card emulation mode with ACR122

久未见 提交于 2019-12-01 13:30:49
问题 I am trying to send some data to the Nexus 4 through NFC (i.e. the card emulation mode). I tried a number of the command APDUs such as writing and updating APDUs, but I couldn't get them to work. What I am trying to say is, I want to send some data (that is not the AID) to the phone after the select APDU command. Thanks in advance, Bader 回答1: The HCE emulated card will understand exactly those commands that your HCE app's APDU service processes. So, for instance, if your HCE service's

Host-based Card Emulation, any guidance please?

若如初见. 提交于 2019-12-01 12:49:38
I'm new to this field, I got a Nexus S ( CyanogenMod11 = Android Kitkat 4.4.2) And I need to use HCE (Host-Based Card Emulation) mode in order to emulate a contactless card. Any guidance on the steps and the tips I need to follow in order to accomplish this? ( - Do I need to program the simulated Secure Element? put it on cloud? ) P.S: I have to use the new Reader Mode also, because my app is going to be read by another Android NfC-enabled phone and not by an NFC reader. Thank you. Michael Roland Before CyanogenMod 11, CyanogenMod supported its own host-based card emulation functionality. You

Frequent Disconnection ACR122U NFC Reader

走远了吗. 提交于 2019-12-01 12:16:54
When I put SIII (Android 4.3) on ACR122U NFC reader the LED keeps blinking green. When I put Samsung S4 (Android 4.3) LED turns green till the time phone is on the reader. In both the cases NFC is turned on and device is in unlocked state. This behaviour translates into frequent disconnections in SIII and a stable connection on S4. Why two phones behave differently? I am aware of the fact that two phones have NFC chipsets from two different vendors namely NXP and Broadcom. My question is what is the source for such inconsistent behaviour among these devices? Another question is why does phone

No supported card terminal found ARC1281U nfc card reader

扶醉桌前 提交于 2019-12-01 12:10:05
问题 I'm trying to do Host card based emulation,HCE using this example for ACR 1281U Nfc card reader. The tutorial Suggest to use nfctools to read logs when connected to the reader b using the command java -cp "C:\DATA\setups\ACR1281U-C1 SDK v1.0\nfctools-examples.jar" org.nfctools.examples.hce.HceDemo But the error I get is on my windows 7 system C:\DATA\setups\ACR1281U-C1 SDK v1.0\nfctools-examples\org\nfctools\examples\hce> java -cp "C:\DATA\setups\ACR1281U-C1 SDK v1.0\nfctools-examples.jar"

Is it possible to transfer NFC data from one Android device to another without the 'Touch to Beam' screen?

一个人想着一个人 提交于 2019-12-01 11:08:23
I am trying to send NFC data from one Android device to another. I was able to do it successfully using the 'Touch to Beam' functionality. But I would like the data transfer to take place automatically as soon as both the devices are together. I saw this question answered in StackOverflow multiple times. Unfortunately, while some say its not possible to send NFC data from one Android device to another this way, some others suggest to try "foreground-dispatching" (which the official documents say is now deprecated). I wasn't successful with "foreground dispatching" though I am not entirely sure

Frequent Disconnection ACR122U NFC Reader

冷暖自知 提交于 2019-12-01 11:07:43
问题 When I put SIII (Android 4.3) on ACR122U NFC reader the LED keeps blinking green. When I put Samsung S4 (Android 4.3) LED turns green till the time phone is on the reader. In both the cases NFC is turned on and device is in unlocked state. This behaviour translates into frequent disconnections in SIII and a stable connection on S4. Why two phones behave differently? I am aware of the fact that two phones have NFC chipsets from two different vendors namely NXP and Broadcom. My question is what

Is it possible to transfer NFC data from one Android device to another without the 'Touch to Beam' screen?

限于喜欢 提交于 2019-12-01 08:46:42
问题 I am trying to send NFC data from one Android device to another. I was able to do it successfully using the 'Touch to Beam' functionality. But I would like the data transfer to take place automatically as soon as both the devices are together. I saw this question answered in StackOverflow multiple times. Unfortunately, while some say its not possible to send NFC data from one Android device to another this way, some others suggest to try "foreground-dispatching" (which the official documents

Emulate a smart card on Android when the NFC Reader does not send a “SELECT AID” APDU

谁都会走 提交于 2019-12-01 07:40:28
问题 I have read the Android documentation about NFC and found that it could emulate an NFC tag. However it requires that you register which AID you serve. Is it possible to create an application that handles communication if the NFC reader does not send a "SELECT AID" APDU? Either by creating an application where the AID in the manifest file is empty, or create some sort of default application. I don't mind if the application has to be in the foreground, if that helps in any way. Thank you in