java - 需要 WinForm 应用程序与 Nexus 7 通信 - 没有合适的 NFC 读卡器

标签 java c# android nfc nexus-7

我在 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:

  1. Parsing the NFC tag and figuring out the MIME type or a URI that identifies the data payload in the tag.
  2. 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.
  3. 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/

相关文章:

java - 如何在 Dropwizard 中使用 Jdbi 的 UserResource

c# - 存储当前行索引的干净实现

android - GridView 的平滑滚动

android - 调试 native Android 应用程序

android - 如何在 Android 布局的多个组件中拥有一个唯一的按钮?

Java:无法将 ArrayList<Long> 写入文本文件

java - SimpleDateFormat 解析时间为一小时(使用 RFC 1123,夏季为 GMT)

c# - 将动态创建的列和行添加到 ListView wpf

java - 同时在多个设备上运行方法 - Android

c# - 禁用外键约束代码优先 EF