阅读空的NFC标签
问题描述:
没有人有任何想法如何编写代码来读取空的NFC标签?我需要使用什么类型的意向过滤器来读取空标签?如果有人能提供一些示例代码,我将不胜感激。我使用Ultralight C标签。阅读空的NFC标签
答
可以使用MifareUltralight
类访问MIFARE Ultralight标签。更具体地说使用readPages()
方法,参见示例代码在http://developer.android.com/guide/topics/connectivity/nfc/advanced-nfc.html#read-write
添加高科技列表引用您的清单,如http://developer.android.com/guide/topics/connectivity/nfc/nfc.html#tech-disc
解释在nfc_tech_filter.xml
文件(存储在子目录res/xml
)你把:
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<tech-list>
<tech>android.nfc.tech.MifareUltralight</tech>
</tech-list>
参考此链接http://stackoverflow.com/questions/5546932/how-to-read-and-write-android-nfc-tags – Abhinai 2012-08-17 08:00:08