Skip to content

NDefDecoder

com.rvi.application.NDefDecoder · Class · SocialCard 1.0.3

Read supported typed records from an NDEF message in record order.

Pass a validated NDefMessage to decode() for all typed content, or decodeURIs() for URI strings. For raw tag-memory bytes, unwrap the TLV first with TlvDecoder.

final NDefMessage message = new NDefEncoder().encodeURIs(
List.of("https://rithush.dev", "mailto:help@example.com"));
final List<String> links = new NDefDecoder().decodeURIs(message);
System.out.println(links);
Java imports
import com.rvi.application.NDefDecoder;
import com.rvi.application.NDefEncoder;
import com.rvi.domain.NDefMessage;
import java.util.List;

Use decode() when your application also needs text, contacts or Wi-Fi information.

The decoder interprets record headers and converts payloads into values. It expands URI prefixes, reads the text language field and parses supported vCard and Wi-Fi credential payloads. decode() returns an immutable list and may reject a payload that passes structural validation.

NDefEncoder · NDefMessage · NDefContent · TlvDecoder · NDefMessageException

Method signatures in the Javadoc · All API types