Skip to content

NDefUri

com.rvi.domain.NDefUri · Record · SocialCard 1.0.3

An absolute URI stored as an NDEF URI record.

Pass a full address such as https://rithush.dev, mailto:help@example.com or tel:+41791234567. Encode spaces as %20. For a single link on a connected tag, writeURI() is the shortest path.

final NDefUri link = new NDefUri(" https://rithush.dev/projects/socialcard/ ");
final NDefMessage message = new NDefMessageCreator().add(link).build();
System.out.println(new NDefDecoder().decodeURIs(message));
Java imports
import com.rvi.application.NDefDecoder;
import com.rvi.application.creator.NDefMessageCreator;
import com.rvi.domain.NDefMessage;
import com.rvi.domain.NDefUri;

Use the record form when the link is part of a mixed message.

The constructor strips outer whitespace, parses with java.net.URI and stores the ASCII form. HTTP and HTTPS require a host and reject user information. The encoder uses an NFC URI prefix identifier when a supported prefix matches the address.

NDefUriCreator · NDefEncoder · IReaderService · NDefValueException

Method signatures in the Javadoc · All API types