通过NFC数据传输到PC机,从Android设备 [英] Transfer data to PC from android device via NFC

查看:1042
本文介绍了通过NFC数据传输到PC机,从Android设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想开发一个Android应用程序的医院。在这个系统中,有必要获得存储在数据库中的机器人的手机变成使用NFC技术的台式计算机的患者信息。反正是有,我可以使用NFC读取USB设备(ACR122U NFC智能卡读写器的RFID读写器5的Mifare USB)将数据从手机转移到我的台式电脑?

I am trying to develop an Android application for a hospital. In this system there is a need to get the patient information stored in the database in the android phone into the desktop computer using NFC technology. Is there anyway where I could use a NFC USB Reading device (ACR122U NFC Smart Card Reader RFID Writer 5 Mifare USB) to transfer the data from the mobile phone to my desktop computer?

的真实场景,这将是,在医院,当一个人希望采取一些试验结果,他将达到给计数器,并将所述移动装置安装在柜台的NFC读取器设备上时这样做的所有细节关于患者应转移到桌面机在柜台

The real scenario for this would be, in a hospital when a person wants to take some test results he will reach to the counter and place the mobile device on the NFC reader device installed at the counter when this is done all the details about the patient should be transferred to the desktop machine at the counter.

我不希望传递大量的信息,如果有任何方式,我可以存储在移动数据库中的患者ID转移到使用NFC桌面这将是足够的。

I don't want to transfer a lot of information if there is any way in which I could transfer the patient id stored in the mobile database into the desktop using NFC that would be enough.

推荐答案

根据您要结合使用与ACR122U NFC阅读器,您多种选择什么样的NFC设备:

Depending on what NFC devices you want to use in combination with the ACR122U NFC reader you multiple options:

  • 如果您只需要更换一个消息(数据包的)在一个方向,你可以使用对等模式。然而,对等体的对等协议栈是相对复杂(相较于其他的替代品)。此外,Android的建于梁的功能会要求用户确认(梁UI)的每封邮件传输。

  • If you only need to exchange a single message (data packet) in a single direction, you could use peer-to-peer mode. However, the peer-to-peer protocol stack is relatively complex (in comparison to the other alternatives). Moreover, Android's built in Beam functionality will request user confirmation (Beam UI) for every message transfer.

如果你只需要支持Android设备与Android 4.4或更高版本(即使在当时并非所有的Andr​​oid NFC设备的支持,看到的这个),你可以使用在读/写模式ACR122U。在读/写器模式下,ACR122U可以与接触式智能卡通信。请参阅读者手册如何访问这些ISO / IEC 14443-4接触式智能卡。在Android的一面,你可以使用基于主机卡仿真(HCE)模式。见href="http://developer.android.com/guide/topics/connectivity/nfc/hce.html" rel="nofollow">的Andr​​oid文档上怎么说在Android 4.4及更高版本的工作

If you only need to support Android devices with Android 4.4 or later (and even then not all Android NFC devices are supported, see this), you could use the ACR122U in reader/writer mode. In reader/writer mode, the ACR122U can communicate with contactless smartcards. See the reader's manual on how to access such ISO/IEC 14443-4 contactless smartcards. On the Android side, you would use the host-based card emulation (HCE) mode. See the Android documentation on how that works on Android 4.4 and later.

在我看来,最好的办法是使用卡模拟模式ACR122U。在卡模拟模式的ACR122U可用于模拟可由就像任何其他NFC标签/接触式智能卡的Andr​​oid设备被检测到标签/接触式智能卡。你可以找到例子,比如,用 libnfc 。另请参见如何把ACR122U成卡仿真模式这个答案。可以在所有的Andr​​oid版本中使用(和BlackBerry,并与一些额外的工作,甚至在Windows Phone一定程度上)这个选项。用此方案,电话将采取在通信和ACR122U(以及所连接的PC)的读写器(询问器)的一部分将是卡(控制组件)。利用技术,如逆读取器模式你可以扭转这种关系。

In my opinion the best option would be to use the ACR122U in card emulation mode. In card emulation mode the ACR122U can be used to emulate a tag/contactless smartcard that can be detected by an Android device just like any other NFC tag/contactless smartcard. You can find examples, for instance, with libnfc. Also see this answer on how to bring the ACR122U into card emulation mode. This option can be used across all Android versions (and on BlackBerry and with some additional effort to some extent even on Windows Phone). With this scenario, the phone would take the reader (interrogator) part in the communication and the ACR122U (and the connected PC) would be the card (controlled component). Using techniques like inverse reader mode you could reverse that relationship.

这篇关于通过NFC数据传输到PC机,从Android设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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