我在 C# 上创建了一个 winform 应用程序。我希望这个应用程序能够读取/写入 NFC 标签并在表单上显示内容。是否可以?或者我必须在 JAVA 上构建应用程序吗?我很困惑。请建议。 我没有合适的 NFC 读取器,希望我的 Nexus 在这里充当读取器和写入器的角色。 我知道我必须为 Nexus 创建另一个应用程序,该应用程序会向桌面应用程序发送确认。那是对的吗?这意味着桌面应用程序 (C#) 需要与 Android 应用程序 (JAVA) 对话? 操作系统:Windows 8.1 平台:C#.Net
如果您认为这些数据不足以回答,请向我询问更多相关信息。 谢谢!
最佳答案
是的,只要您的设备具有 NFC 硬件,您绝对可以做到这一点。 (我相信 Nexus 7 可以)
您可能想要做的是以 NDEF 消息的形式发送和接收 NFC 数据。
您需要添加 list 权限:
<uses-permission android:name="android.permission.NFC" />
Android操作系统可以帮助您处理NFC数据:
Android provides a special tag dispatch system that analyzes scanned NFC tags, parses them, and tries to locate applications that are interested in the scanned data. It does this by:
- Parsing the NFC tag and figuring out the MIME type or a URI that identifies the data payload in the tag.
- Encapsulating the MIME type or URI and the payload into an intent. These first two steps are described in How NFC tags are mapped to MIME types and URIs.
- Starts an activity based on the intent. This is described in How NFC Tags are Dispatched to Applications.
参见documentation .
关于java - 需要 WinForm 应用程序与 Nexus 7 通信 - 没有合适的 NFC 读卡器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26014573/