API reference
Every type has its own page with a Java example, usage guidance and a walkthrough of what happens inside the library. This reference covers all 31 public types in SocialCard 1.0.3, plus two private records that explain how the encoder and decoder handle bytes.
Get started with a complete Java program · Follow a write from Java to the tag · Browse the full Javadocs
Find an example
Section titled “Find an example”- Write a link or read a tag
- Compose multiple records
- Estimate tag storage
- Decode a message in Java
- Watch for card insertion
Reader service
Section titled “Reader service”ReaderService· Discover PC/SC readers and open a connection to a tag.IReaderService· Read, encode and write NDEF through a single card connection.
Data model
Section titled “Data model”NDefMessage· Validated raw NDEF bytes representing one or more records.NDefContent· Common type for URI, text, contact and Wi-Fi records.NDefUri· An absolute URI stored as an NDEF URI record.NDefText· A UTF-8 NDEF text record with a language tag.NDefContact· A contact encoded as a vCard 4.0 NDEF record.NDefWifi· An open or WPA2-Personal network stored as a Wi-Fi credential record.WifiAuthentication· Selects how a client authenticates to the advertised Wi-Fi network.WifiEncryption· Selects the encryption associated with a Wi-Fi record.
Builders
Section titled “Builders”NDefMessageCreator· Build a single NDEF message from an ordered list of typed records.NDefUriCreator· Collect a URI and build a validated link record.NDefTextCreator· Build a text record and optionally specify its language.NDefContactCreator· Build a vCard record by setting only the contact fields you have.NDefWifiCreator· Build a Wi-Fi credential record for an open or WPA2-Personal network.
Encoding and decoding
Section titled “Encoding and decoding”NDefEncoder· Serialise URI, text, contact and Wi-Fi records into raw NDEF bytes.NDefDecoder· Read supported typed records from an NDEF message in record order.TlvEncoder· Wrap an NDEF message as a Type 2 Tag TLV byte sequence.TlvDecoder· Read an NDEF message from its Type 2 Tag TLV wrapper.
Reader integration
Section titled “Reader integration”ReaderRepository· Translate validated NDEF messages into reads and writes on a PC/SC card channel.IReaderRepository· Define the card transport contract used by the reader service.ReaderMonitor· Observe insertion and removal of cards on one PC/SC terminal.IReaderListener· Define callbacks for card insertion, removal and monitor failures.ReaderListener· Write a predefined NDEF message on each insertion event.
Exceptions
Section titled “Exceptions”CardCapacityException· Signals that the encoded write exceeds the available tag capacity.ReaderServiceException· Report reader discovery, connection and card-operation failures.TlvException· Report invalid or unsupported Type 2 Tag TLV layout.NDefEncodingException· Report invalid input to the NDEF encoder.NDefValueException· Report invalid data in an individual NDEF record.NDefMessageException· Report invalid NDEF bytes or a payload the decoder cannot represent.
Demo and internals
Section titled “Demo and internals”Main· Demonstrate a complete write and read-back with a link and a text record.NDefEncoder.EncodedValue· Hold the record type and payload before the encoder writes the NDEF bytes.TlvDecoder.Header· Represent the parsed header and declared value length of a tag-memory wrapper.