How to make an Android phone act like a contactless (NFC) terminal

倾然丶 夕夏残阳落幕 提交于 2019-12-24 13:40:33

问题


In order to help debug a HCE app I would like to make an Android phone act as a contactless terminal.

Is this possible without rooting the phone and using NFCProxy? (http://sourceforge.net/projects/nfcproxy/)

i.e. I have two phones and want to run my app on one while making the other act as a reader.


回答1:


This is only possible if your reader Android device (the one that acts as contactless terminal) has Android 4.4 or later.

The problem is that Android's HCE capabilities run in parallel with its peer-to-peer mode capablities (regardless of whether the device has support for Android Beam enabled or not). As a consequence, other Android devices will detect Android HCE devices as peer-to-peer devices and, by default, communicate with them in peer-to-peer mode. Therefore, other Android devices will normally be unable to access an Android HCE emulated smartcard application.

Starting with Android 4.4, you can prevent this by disabling peer-to-peer mode discovery using the reader mode API.




回答2:


Looks like this project does emulation of a contactless terminal (for at least some of the conversation) https://github.com/doc-rj/smartcard-reader



来源:https://stackoverflow.com/questions/26389168/how-to-make-an-android-phone-act-like-a-contactless-nfc-terminal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!