public final class NfcCardReader
extends java.lang.Object
NfcCardReader
provides an interface to read Card
information from cards with an NFC chip.Modifier and Type | Class and Description |
---|---|
static class |
NfcCardReader.Error
Errors for
Listener#onError(Error) . |
static interface |
NfcCardReader.Listener
Listener interface for a
NfcCardReader . |
Modifier and Type | Method and Description |
---|---|
void |
disable()
Disable the reader.
|
void |
enableWithSounds(boolean playSounds)
Enable the reader.
|
static NfcCardReader |
getInstance(Activity activity,
NfcCardReader.Listener listener)
Create a new
NfcCardReader . |
boolean |
isNfcEnabledOnDevice() |
public static NfcCardReader getInstance(Activity activity, NfcCardReader.Listener listener)
NfcCardReader
.activity
- The hosting Activity
.listener
- The NfcCardReader.Listener
used to receive callbacks.NfcCardReader
or null
, if the device does not have an NfcAdapter
.public boolean isNfcEnabledOnDevice()
public void enableWithSounds(boolean playSounds)
Activity#onResume()
.public void disable()
Activity#onPause()
.