android4.4.2 nfc卡死,Android 4.4.2, PN532 NFC reader and NFC Card emulation

That depends on what Nexus tablet you have:

Nexus 7 (first generation/2012 version): This device uses NXP's PN544 NFC controller. It seems that it's currently not possible to perform host-based card emulation with Android 4.4+ on these devices (see this question and my answer here).

Nexus 7 (second generation/2013 version) and Nexus 10: These devices use Broadcom's NFC controller. Therefore, you can use Android 4.4's HCE API to emulate a contactless smartcard.

With Android's HCE API you will emulate an ISO 14443-4 smartcard and you can only communicate using the application selection and APDU format defined in ISO 7816-4. You would first create and register a HCE service (see the API guide). Then you can process incoming APDUs using the service's processCommandApdu() method (see this answer).

If your reader-side application currently only processes MIFARE Classic and Ultralight, you would have to extend it to also communicate with ISO 14443-4/APDU-based smartcards. (Emulation of non-APDU based cards like MIFARE Classic and Ultralight is not possible on top of ANdroid's HCE API.) The PN532 will typically handle the bigger part of this for you, so once you discover such a smartcard (e.g. with InListPassiveTarget) it should automatically handle the ISO 14443-4 transport protocol and you can directly send APDU commands using the InDataExchange command.

If you want to exchange NDEF messages over HCE, once you have APDU-based communication up and running, you could implement the NFC Forum's Type 4 Tag Operation specification (get it from the NFC Forum's website) within the Android HCE service to emulate a Type 4 NDEF tag.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值