public class NfcConnection
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
NfcInterface |
nfcInterface |
static java.lang.String |
PARAM_DOB |
static java.lang.String |
PARAM_DOC_NUM |
static java.lang.String |
PARAM_DOE |
Constructor and Description |
---|
NfcConnection() |
Modifier and Type | Method and Description |
---|---|
static NfcConnection |
getInstance()
Is used for accessing the NfcConnection object.
|
PassportModel |
getPassportModel() |
void |
init(android.content.Context context,
android.app.Activity activity)
Is called before the NFC scan and sets up
the hosts's NFC scanner.
|
void |
onNewIntent(android.content.Intent intent)
Is added inside onNewIntent method in the activity to activate the
host's NFC scanner.
|
void |
onPause()
Is a NfcConnection lifecycle method.
|
void |
onResume()
Is a NfcConnection lifecycle method.
|
void |
setNfcInterface(NfcInterface nfcInterface)
Is set for accessing the incoming NFC data
|
void |
setPassportModel(PassportModel passportModel)
Sets the obtained PassportModel object from the MRZ scan, to further store the data from NFC scan.
|
static void |
stopForegroundDispatch(android.app.Activity activity,
android.nfc.NfcAdapter adapter) |
public static final java.lang.String PARAM_DOC_NUM
public static final java.lang.String PARAM_DOB
public static final java.lang.String PARAM_DOE
public NfcInterface nfcInterface
public PassportModel getPassportModel()
public void setPassportModel(PassportModel passportModel)
Sets the obtained PassportModel object from the MRZ scan, to further store the data from NFC scan. This is required to perform an NFC scan.
passportModel
- parsed MRZ data.public static NfcConnection getInstance()
Is used for accessing the NfcConnection object.
public void init(android.content.Context context, android.app.Activity activity)
Is called before the NFC scan and sets up the hosts's NFC scanner.
public void onResume()
public void onPause()
public static void stopForegroundDispatch(android.app.Activity activity, android.nfc.NfcAdapter adapter)
public void onNewIntent(android.content.Intent intent)
intent
- public void setNfcInterface(NfcInterface nfcInterface)
nfcInterface
- is used for accessing NFC data