Writing multiple data types in NFC tags in a single tap

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 05:17:01

问题


Is it possible to write more than one data type (like two urls or one url and one text) into a NFC tag from Android in a single tap?


回答1:


You can, but when you scan a tag, it can only have one data type that Android uses to determine what type of tag it is. This data type is determined by the first NDEF record in your NDEF message. Android assigns a MIME type or URI to this record so it can figure out which application is best to start to handle the tag. So, if you write a text record and URI on a tag, Android will think it is a plain text tag if that record is first, or a URI tag if that record is first. You can still read all the data as normal though.




回答2:


Yes, if you are using Ndef. What you have to do is add more than one Ndef record to a Ndef message, then you can send the whole message in one tap. The main things that limit how many records you can add to the message are the size of the entire message and the memory size on the receiving device (like a tag). If your message is larger than the available memory, it won't send.



来源:https://stackoverflow.com/questions/8927642/writing-multiple-data-types-in-nfc-tags-in-a-single-tap

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!