hce

Making NFC/Beam more automatic

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 05:26:15
I am adding NFC/Beam capabilities to my app and I would like it to work as automatically as possible. I would like to get rid of the "Touch To Beam" screen from the sender and the "New tag scanned" screen from the receiver. Basically, I want it to work like it does in the Samsung commercial!!! I read in stackoverflow that it seems like there may not be a way to get rid of the "Touch To Beam" screen, however I am hoping someone has some updated information or knows how to remove the receiver screen. Thanks! Sending side When using NFC peer-to-peer communication (aka Android Beam) between two

Making NFC/Beam more automatic

五迷三道 提交于 2019-12-01 03:07:29
问题 I am adding NFC/Beam capabilities to my app and I would like it to work as automatically as possible. I would like to get rid of the "Touch To Beam" screen from the sender and the "New tag scanned" screen from the receiver. Basically, I want it to work like it does in the Samsung commercial!!! I read in stackoverflow that it seems like there may not be a way to get rid of the "Touch To Beam" screen, however I am hoping someone has some updated information or knows how to remove the receiver

NFC reader “SELECT (by AID)” APDU is not routed to Android device

时光毁灭记忆、已成空白 提交于 2019-11-30 15:38:22
I have an ACR122U NFC reader/writer connected to my Windows machine with ACR122 driver installed. I try to use javax.smartcardio API to send an SELECT (by AID) ADPU to my Android device (which should be in HCE mode). This is my code: TerminalFactory factory = TerminalFactory.getDefault(); List<CardTerminal> terminals = factory.terminals().list(); CardTerminal terminal = terminals.get(0); System.out.println(terminal.getName()); Card card = terminal.connect("*"); CardChannel channel = card.getBasicChannel(); execute(channel, new byte[] { (byte) 0xFF, 0x00, 0x51, (byte) 195, 0x00}, card); execute

Set application default payment service

左心房为你撑大大i 提交于 2019-11-30 07:39:34
Let's think about a case where user has installed multiple applications capable of NFC HCE payments. Those application services are visible under settings NFC Tap and Pay. How to programmatically change your application to be the default payment service if it's not? CardEmulation seems only to have API to query if service for category is default. Thanks. The main idea behind having that UI is that the user can decide on which payment app should be the default app. Consequently, there is no way to programmatically set your app to be the default. However, you can request the user to set your app

KitKat: How to route APDUs to the SIM

跟風遠走 提交于 2019-11-30 06:33:06
问题 I want to route APDUs I get from an NFC Reader to the SIM Card. According to the HCE documentation I thought it would be possible simply by creating an OffHostApduService with the according routing-entries (which I did). Sadly, the SIM does not seem to get any APDUs. SELECT-Commands that work when the SIM is directly attached to my workstation by a SIM-Reader return with 6a82 (File not found). In LogCat I found two interesting bits of information: Every time I shoot a select command which

NFC reader “SELECT (by AID)” APDU is not routed to Android device

。_饼干妹妹 提交于 2019-11-29 23:04:51
问题 I have an ACR122U NFC reader/writer connected to my Windows machine with ACR122 driver installed. I try to use javax.smartcardio API to send an SELECT (by AID) ADPU to my Android device (which should be in HCE mode). This is my code: TerminalFactory factory = TerminalFactory.getDefault(); List<CardTerminal> terminals = factory.terminals().list(); CardTerminal terminal = terminals.get(0); System.out.println(terminal.getName()); Card card = terminal.connect("*"); CardChannel channel = card

How to check my NFC TAG ID (UID)?

橙三吉。 提交于 2019-11-29 08:57:47
It is possible to know others NFC TAG ID when we used to the APK & TAG each phones. For example, Phone A and B try to tag. Then Phone A can know Phone B's NFC TAG ID (4 Bytes - HEX). But I wanna know how to know my NFC TAG ID on my phone. Not used other phones. If you know any other information, please give me your advice on that. A phone does not necessarily have a fixed anti-collision identifier ("NFC Tag ID", as you call it). For instance, it could have an anti-collision identifier, that is randomly allocated on every activation (e.g. external HF field is turned on, phone is turned on, etc.

Why doesn't Android HCE support Mifare Classic type?

旧时模样 提交于 2019-11-29 07:44:47
Mifare Classic is the most used cards and I can't understand why HCE (Host-based Card Emulation) only supports ISO 14443-4, but not Mifare Classic type. Because NXP stops them from using their proprietary protocols and algorithms? Or because they didn’t implement Mifare Classic in Android OS level? Any comments will be very appreciated. Short answer: Because Google decided to support only ISO/IEC 7816-4 over ISO-DEP (ISO/IEC 14443-4). Speculations on why they decided that way: First of all, ISO/IEC 7816-4 over ISO-DEP is the highes protocol layer that could be used to route communication to

Application not visible in Tap and Pay

僤鯓⒐⒋嵵緔 提交于 2019-11-29 07:32:26
What is the key thing to adjust in NFC HCE application to get it visible under settings NFC Tap and Pay Following code returns true for the app, so it's capable of payment: boolean isDefault = CardEmulation .getInstance(NfcAdapter.getDefaultAdapter(this)) .isDefaultServiceForCategory( new ComponentName(this, MyPaymentService.class), CardEmulation.CATEGORY_PAYMENT); Service declaration in manifest: <service android:name="my.package.MyPaymentService" android:exported="true" android:permission="android.permission.BIND_NFC_SERVICE" > <intent-filter> <action android:name="android.nfc.cardemulation

Android HCE: are there rules for AID?

感情迁移 提交于 2019-11-29 00:21:17
I'm trying to use an ACR122 NFC reader to select an application emulated in one Nexus 5 using Android Host Card Emulation. However, small AIDs are not recognized. My goal is to use a three byte long AID, as I do in a DESfire card. My first goal is only to be able to do a SELECT command. My test app uses the following configuration for AIDs: <host-apdu-service xmlns:android="http://schemas.android.com/apk/res/android" android:description="@string/service_descr" android:requireDeviceUnlock="false" > <aid-group android:category="other" android:description="@string/aid_descr" > <aid-filter android