0

我使用在 VirtualBox 下运行的 Android 4.4 并连接了 ACR122U NFC 阅读器。

我在清单中添加了几行:

<uses-permission android:name="android.permission.NFC" />
<uses-feature android:name="android.hardware.nfc" android:required="true" />

和:

<intent-filter>
    <action android:name="android.nfc.action.TAG_DISCOVERED" />
    <category android:name="android.intent.category.DEFAULT" />
</intent-filter>

并尝试通过以下方式检查 NFC 阅读器

nfcAdapter = NfcAdapter.getDefaultAdapter(this);
if(nfcAdapter == null) {
    Toast.makeText(this, "NFC NOT supported on this devices!", Toast.LENGTH_LONG).show();

但收到不支持 NFC 的消息。我在哪里做错了?

4

1 回答 1

0

Android NFC 堆栈不支持开箱即用的 ACR122U 读卡器。实际上,我怀疑您是否能够为 NFC 堆栈编写一个可以使用该读取器的驱动程序层,因为它仅支持 Android 设备中当前 NFC 控制器功能的子集,并且由于 PN532 NFC 芯片在与当前的 NFC 控制器(使用 NCI)相比,ACR122U 使用完全不同的协议。

于 2016-12-08T09:56:49.197 回答