使用支持 NFC 的 Android 手机读取标签

发布于 2024-12-17 00:06:27 字数 343 浏览 5 评论 0原文

API 演示对我来说无法理解。我购买了 Milfare 1K Labels-Tag,与著名的“NFC TagWrite”应用程序配合得很好。

所以我想将其实现到我自己的应用程序中。我不需要将内容写入标签,而是读取它。我知道每当手机触摸特定标签类型时,我的清单(带有 MIME 类型)中必须有一个减速,以便告诉我的应用程序来应用程序。我确实知道必须有一种 Nfc 记录来发出特定的 Ndef 消息。

这怎么能做到呢?我有我的活动,每当带有“XYZ”类型的标签被触摸到手机时,该活动就应该出现。它应该只显示纯文本,没有其他内容。在屏幕上,内容应显示在简单的 TextView (id=tagContent) 中。

我必须做什么?

The API demo is not understandable for me. I have bought A Milfare 1K Labels-Tag, works great with the well known "NFC TagWrite" App.

So I want to implement this into my own app. I do not need to write content to tags, but read it. I know there must be a decleration in my Manifest (with MIME-Type) in order to tell my app to come app, whenever a specific tag type has been touched to the phone. I do know there must be a kind of Nfc-Record to make a specific Ndef Message.

How can this be done? I have my activity, which should be come a, whenever a tag with typ "XYZ" has been touched to the phone. It should simply show plain-text, nothing else. On the screen, the content should appear in a simple TextView (id=tagContent).

What do I have to do?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

讽刺将军 2024-12-24 00:06:27

要做到这一点,需要做很多事情。幸运的是,以下帖子中描述了所有内容:

http ://mifareclassicdetectiononandroid.blogspot.com/2011/04/reading-mifare-classic-1k-from-android.html

祝你好运!

There are bunch of things that needs to be in place to do this. Luckily, everything is described in the following post:

http://mifareclassicdetectiononandroid.blogspot.com/2011/04/reading-mifare-classic-1k-from-android.html

Good luck!

路弥 2024-12-24 00:06:27

我认为您应该尝试使用 mfc.authenticateSectorWithKeyB 而不是示例中的“A”进行身份验证。它对我有用。

I think you should try authenticating with mfc.authenticateSectorWithKeyB instead of the 'A' in the sample. it worked for me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文