如何使Android手机像非接触式(NFC)终端一样工作 [英] How to make an Android phone act like a contactless (NFC) terminal

查看:378
本文介绍了如何使Android手机像非接触式(NFC)终端一样工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了帮助调试HCE应用,我想让Android手机充当非接触式终端.

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

是否可以在不植根电话和不使用NFCProxy的情况下实现? ( http://sourceforge.net/projects/nfcproxy/)

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.

推荐答案

仅当您的阅读器Android设备(充当非接触式终端的设备)具有Android 4.4或更高版本时,这才可能.

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

问题在于,Android的HCE功能与其对等模式功能并行运行(无论该设备是否支持Android Beam).因此,其他Android设备会将Android HCE设备检测为对等设备,并且默认情况下以对等模式与它们进行通信.因此,其他Android设备通常将无法访问Android HCE模拟的智能卡应用程序.

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.

从Android 4.4开始,您可以使用

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

这篇关于如何使Android手机像非接触式(NFC)终端一样工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆