Reputation: 20000
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?
Upvotes: 2
Views: 4803
Reputation: 19
As it is stated in other answers the desired result can be achieved through NDEF records. For those asking about how to write multiple NDEF records here is a very detailed resource on how to do that. Designing an NFC "Multiple NDEF record"
Upvotes: 0
Reputation: 2132
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.
Upvotes: 1
Reputation: 884
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.
Upvotes: 0