<oembed><type>rich</type><version>1.0</version><author_name>npub18fpvcsep7mwe4zfg4nsaquey5q7u6r5c8y3928258grwarxmtuusay739f</author_name><author_url>https://nostr.ae/npub18fpvcsep7mwe4zfg4nsaquey5q7u6r5c8y3928258grwarxmtuusay739f</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2014-03-07&#xA;📝 Original message:2014-03-07 11:23 GMT+01:00 Andreas Schildbach &lt;andreas at schildbach.de&gt;:&#xA;&#xA;&#xA;&gt; Good news: HCE offers the required dispatch ability -- they call it AID&#xA;&gt; (Application ID).&#xA;&gt;&#xA;&#xA;Yes, that&#39;s also something adopted from the existing Smartcard world.&#xA;Existing smartcards can contain different payment applications (for example&#xA;in Germany the &#34;Maestro&#34; and the &#34;Geldkarte&#34; application on the same card).&#xA;So the terminal can actively request one specific application within the&#xA;Smartcard.&#xA;&#xA;But as Mike correctly said, we have no pre-existing infrastructure to&#xA;support. So decisions should only be based on what makes sense for the&#xA;future.&#xA;&#xA;&#xA;Bad news: It seems - at least CATEGORY_PAYMENT - very credit card centric.&#xA;&gt;&#xA;&#xA;I&#39;m not sure about this. I&#39;ve built several HCE test apps and tested them&#xA;with readers (and other phones used as reader) but I did not notice any&#xA;difference to using CATEGORY_OTHER (besides that the apps using&#xA;CATEGORY_PAYMENT appear in KitKat&#39;s new shiny &#34;Tap &amp; Pay&#34; menu).&#xA;&#xA;&#xA;HCE seems to cover only the payer side. I wonder if there is also an API&#xA;&gt; for &#34;reader emulation&#34; which we would need for apps to support the payee&#xA;&gt; side.&#xA;&gt;&#xA;&#xA;You are free to implement whatever protocol you want. On the reader side&#xA;you simply do a IseDep &#34;connect()&#34; and send your commands with&#xA;&#34;transceive()&#34; (&#xA;https://developer.android.com/reference/android/nfc/tech/IsoDep.html#transceive(byte[])).&#xA;After sending the initial ISO 7816-4 &#34;SELECT APPLICATION&#34; command (see here&#xA;for some ISO 7816-4 doc:&#xA;http://www.cardwerk.com/smartcards/smartcard_standard_ISO7816-4_6_basic_interindustry_commands.aspx#chap6_11)&#xA;which triggers Android HCE routing mechanism to route all following PDUs to&#xA;your HCE app, you are free to send whatever you want.&#xA;&#xA;Anything you send with &#34;transceve()&#34; on the sender side, will be received&#xA;within your HCE application in the &#34;processCommandApdu&#34; method:&#xA;https://developer.android.com/reference/android/nfc/cardemulation/HostApduService.html#processCommandApdu(byte[],&#xA;android.os.Bundle)&#xA;&#xA;The only limitation is that you have a strict request/response model. The&#xA;reader terminal (or the reading phone) sends a request, the HCE phone sends&#xA;a response.&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20140307/c8eeac9b/attachment.html&gt;</html></oembed>