RFID reader
Use the method below to open RFID chip reading controller and start its processing:

#1

Java
Kotlin
1
DocumentReader.Instance().startRFIDReader(MainActivity.this, new IDocumentReaderCompletion() {
2
@Override
3
public void onCompleted(int rfidAction, DocumentReaderResults results, Throwable error) {
4
// do something
5
}
6
});
Copied!
1
DocumentReader.Instance().startRFIDReader(this@MainActivity) { rfidAction, results_RFIDReader, _ ->
2
// do something
3
}
Copied!

#2

Java
1
DocumentReader.Instance().startRFIDReader(MainActivity.this, documentReaderCompletion, rfidReaderRequest);
2
3
private IDocumentReaderCompletion documentReaderCompletion = new IDocumentReaderCompletion() {
4
@Override
5
public void onCompleted(int action, DocumentReaderResults results, DocumentReaderException error) {
6
// do something
7
}
8
};
9
10
private IRfidReaderRequest rfidReaderRequest = new IRfidReaderRequest() {
11
@Override
12
public void onRequestPACertificates(byte[] serialNumber, PAResourcesIssuer issuer, IRfidPKDCertificateCompletion completion) {
13
// do something
14
}
15
16
@Override
17
public void onRequestTACertificates(String keyCAR, IRfidPKDCertificateCompletion completion) {
18
// do something
19
}
20
21
@Override
22
public void onRequestTASignature(TAChallenge challenge, IRfidTASignatureCompletion completion) {
23
// do something
24
}
25
};
Copied!

#3

Java
1
DocumentReader.Instance().startRFIDReader(MainActivity.this, documentReaderCompletion, null, rfidNotificationCompletion);
2
3
private IDocumentReaderCompletion documentReaderCompletion = new IDocumentReaderCompletion() {
4
@Override
5
public void onCompleted(int action, DocumentReaderResults results, DocumentReaderException error) {
6
// do something
7
}
8
};
9
10
private IRfidNotificationCompletion rfidNotificationCompletion = new IRfidNotificationCompletion() {
11
@Override
12
public void onRfidNotification(int notificationType, @Nullable @org.jetbrains.annotations.Nullable Bundle value) {
13
Log.d("MainActivity", "RFID notification: " + notificationType + ", value: " + value);
14
}
15
};
Copied!
Use the method below to stop RFID chip reading programmatically:
Java
Kotlin
1
DocumentReader.Instance().stopRFIDReader(MainActivity.this);
Copied!
1
DocumentReader.Instance().stopRFIDReader(this@MainActivity)
Copied!
Last modified 5mo ago
Copy link