Enum TagType

java.lang.Object
java.lang.Enum<TagType>
com.codename1.nfc.TagType
All Implemented Interfaces:
Comparable<TagType>

public enum TagType extends Enum<TagType>

Tag technologies that a discovered Tag may support. A single tag typically reports several entries -- e.g. a MIFARE Classic 1K tag returns [NFC_A, MIFARE_CLASSIC, NDEF] -- so callers use Tag.supports(TagType) to decide which API to call.

Not every platform exposes every technology:

  • Android -- exposes the full set via android.nfc.tech.*.
  • iOS -- Core NFC exposes only NDEF, ISO_DEP (ISO 14443-4 / ISO 7816), NFC_F (FeliCa), and MIFARE_ULTRALIGHT (as a subset of NFCMiFareTag). MIFARE Classic is intentionally not supported by Apple and reports as NFC_A only.
  • JavaSE simulator -- all values are emulated; the Simulate -> NFC menu lets you set the tech list per virtual tag.
  • Enum Constant Details

    • NDEF

      public static final TagType NDEF
      Tag carries an NDEF message that can be read by Tag.readNdef() and (if writable) updated by Tag.writeNdef(NdefMessage). The vast majority of consumer-facing NFC tags include this technology.
    • ISO_DEP

      public static final TagType ISO_DEP
      ISO 14443-4 / ISO 7816-4 -- contact-less smart cards, EMV payment cards, ePassports, government ID. Use [IsoDep#transceive(byte[])] to send APDUs. Available on Android via IsoDep and on iOS via NFCTagReaderSession with NFCISO7816Tag.
    • MIFARE_CLASSIC

      public static final TagType MIFARE_CLASSIC
      NXP MIFARE Classic 1K/4K. Block-level read/write with key A/B authentication via MifareClassic. Android-only -- iOS intentionally does not expose this technology.
    • MIFARE_ULTRALIGHT

      public static final TagType MIFARE_ULTRALIGHT
      NXP MIFARE Ultralight / Ultralight C / NTAG (NTAG213/215/216). Page-level read/write via MifareUltralight. Supported on both Android (MifareUltralight) and iOS (NFCMiFareTag).
    • NFC_A

      public static final TagType NFC_A
      NFC Forum Type 2 (low-level NFC-A / ISO 14443-3A). Use NfcA for raw transceive.
    • NFC_B

      public static final TagType NFC_B
      NFC Forum Type 4B (ISO 14443-3B). Android-only.
    • NFC_F

      public static final TagType NFC_F
      FeliCa (JIS X 6319-4) -- Japanese transit / payment cards. Use NfcF for raw transceive. Supported on Android and on iOS 13+ via NFCFeliCaTag. App must declare its system codes in the iOS plist com.apple.developer.nfc.readersession.felica.systemcodes.
    • NFC_V

      public static final TagType NFC_V
      ISO 15693 -- vicinity cards used in libraries, ski-lift passes, blood bags. Android-only.
  • Method Details

    • values

      public static TagType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static TagType valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null