使用支持 NFC 的 Android 手机读取标签
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要做到这一点,需要做很多事情。幸运的是,以下帖子中描述了所有内容:
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!
我认为您应该尝试使用 mfc.authenticateSectorWithKeyB 而不是示例中的“A”进行身份验证。它对我有用。
I think you should try authenticating with mfc.authenticateSectorWithKeyB instead of the 'A' in the sample. it worked for me.