NDefUri
com.rvi.domain.NDefUri · Record · SocialCard 1.0.3
An absolute URI stored as an NDEF URI record.
When to use it
Section titled “When to use it”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.
Java example
Section titled “Java example”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.
How it works
Section titled “How it works”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.
Related API
Section titled “Related API”NDefUriCreator · NDefEncoder · IReaderService · NDefValueException