Enum TagType
- All Implemented Interfaces:
Comparable<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), andMIFARE_ULTRALIGHT(as a subset ofNFCMiFareTag). MIFARE Classic is intentionally not supported by Apple and reports asNFC_Aonly. - JavaSE simulator -- all values are emulated; the Simulate -> NFC menu lets you set the tech list per virtual tag.
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionISO 14443-4 / ISO 7816-4 -- contact-less smart cards, EMV payment cards, ePassports, government ID.NXP MIFARE Classic 1K/4K.NXP MIFARE Ultralight / Ultralight C / NTAG (NTAG213/215/216).Tag carries an NDEF message that can be read byTag.readNdef()and (if writable) updated byTag.writeNdef(NdefMessage).NFC Forum Type 2 (low-level NFC-A / ISO 14443-3A).NFC Forum Type 4B (ISO 14443-3B).FeliCa (JIS X 6319-4) -- Japanese transit / payment cards.ISO 15693 -- vicinity cards used in libraries, ski-lift passes, blood bags. -
Method Summary
Methods inherited from class Enum
clone, compareTo, equals, getDeclaringClass, getEnumValues, hashCode, name, ordinal, setEnumValues, toString, valueOf
-
Enum Constant Details
-
NDEF
Tag carries an NDEF message that can be read byTag.readNdef()and (if writable) updated byTag.writeNdef(NdefMessage). The vast majority of consumer-facing NFC tags include this technology. -
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 viaIsoDepand on iOS viaNFCTagReaderSessionwithNFCISO7816Tag. -
MIFARE_CLASSIC
NXP MIFARE Classic 1K/4K. Block-level read/write with key A/B authentication viaMifareClassic. Android-only -- iOS intentionally does not expose this technology. -
MIFARE_ULTRALIGHT
NXP MIFARE Ultralight / Ultralight C / NTAG (NTAG213/215/216). Page-level read/write viaMifareUltralight. Supported on both Android (MifareUltralight) and iOS (NFCMiFareTag). -
NFC_A
-
NFC_B
NFC Forum Type 4B (ISO 14443-3B). Android-only. -
NFC_F
-
NFC_V
ISO 15693 -- vicinity cards used in libraries, ski-lift passes, blood bags. Android-only.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-