# Package com.codename1.nfc

package com.codename1.nfc

Near Field Communication (NFC) API: read and write NDEF messages, exchange APDUs with contactless smart cards, and host-emulate as a card.

`Nfc.getInstance()` returns the platform implementation; supporting classes cover NDEF (`NdefMessage`, `NdefRecord`), tag discovery (`Tag`, `TagType`, `TagTechnology`, `NfcListener`, `NfcReadOptions`), specific tag technologies (`IsoDep`, `MifareClassic`, `MifareUltralight`, `NfcA`, `NfcB`, `NfcF`, `NfcV`), APDU exchange (`ApduResponse`) and host card emulation (`HostCardEmulationService`). Failures surface through `NfcError` and `NfcException`.

- Class
  Description
  ApduResponse
  Helpers for working with the ISO 7816 status word (SW1/SW2) trailer at the end of every APDU response.
  HostCardEmulationService
  Application-supplied handler for Host Card Emulation (HCE) -- the mode where the device acts as a contactless smart card and answers APDUs from a nearby reader/terminal.
  IsoDep
  ISO 14443-4 / ISO 7816-4 technology view: send APDU command-response pairs to a contactless smart card (EMV payment, ePassport, government ID, transit).
  MifareClassic
  NXP MIFARE Classic 1K/4K technology view.
  MifareUltralight
  NXP MIFARE Ultralight / Ultralight C / NTAG21x technology view.
  NdefMessage
  An NDEF message -- the payload of an NDEF-formatted tag.
  NdefRecord
  A single NDEF (NFC Data Exchange Format) record.
  Nfc
  Entry point for the Codename One NFC API -- read and write NDEF messages, exchange APDUs with smart cards, and host-emulate as a contactless card.
  NfcA
  NFC-A (ISO 14443-3A) raw transceive view.
  NfcB
  NFC-B (ISO 14443-3B) raw transceive view.
  NfcError
  Typed error codes returned by `Nfc` and `HostCardEmulationService` when an asynchronous NFC operation fails.
  NfcException
  Thrown via the failure path of an `AsyncResource` returned by `Nfc` when an NFC read, write, or HCE operation fails.
  NfcF
  FeliCa (JIS X 6319-4) technology view -- the contactless protocol used by Suica, PASMO, ICOCA and other Japanese transit / payment cards.
  NfcListener
  Callback for long-running tag-discovery sessions registered via `Nfc.addTagListener(NfcListener)`.
  NfcReadOptions
  Configures a single call to `Nfc.readTag(NfcReadOptions)` or `Nfc.addTagListener(NfcListener)`.
  NfcV
  ISO 15693 (vicinity-card) technology view.
  Tag
  A tag discovered by `Nfc.readTag(NfcReadOptions)` or `Nfc.addTagListener(NfcListener)`.
  TagTechnology
  Common surface for the low-level technology views attached to a `Tag` -- `IsoDep`, `MifareClassic`, `MifareUltralight`, `NfcA`, `NfcB`, `NfcF`, `NfcV`.
  TagType
  Tag technologies that a discovered `Tag` may support.