Skip to content

QR Code Reader Screen

Introduction

This screen allows a user to scan a QR code either from a picture on the device or with the camera. In the onboarding process, this is used to scan the QR code to get the application information and then use a different authentication method to authenticate the user.

QR Code Reader Screen

Examples

val screen = QRCodeReaderScreen(getTargetContext())
val css = QRCodeReaderSettings.Builder()
    .setAutoFocus(false)
    .setBarcodeFormat(233)
    .setInvalidQROk("invalid")
    .setInvalidQRMessage("invalid qr")
    .setSkipConfirmScreen(true)
    .setWaitForBarcodeDetectorInSec(10)
    .setInvalidQRTitle("Error")
    .setQrCodeReaderActionHandler("com.sap.action")
    .build()
screen.initialize(css)
screen.setPhotoLibraryButtonOnClickListener {
    ...
}
screen.setCloseReaderButtonOnClickListener {
    ...
}
QRCodeReaderScreen screen = new QRCodeReaderScreen(getTargetContext());
QRCodeReaderSettings css = new QRCodeReaderSettings.Builder()
    .setAutoFocus(false)
    .setBarcodeFormat(233)
    .setInvalidQROk("invalid")
    .setInvalidQRMessage("invalid qr")
    .setSkipConfirmScreen(true)
    .setWaitForBarcodeDetectorInSec(10)
    .setInvalidQRTitle("Error")
    .setQrCodeReaderActionHandler("com.sap.action")
    .build();
screen.initialize(css);
screen.setPhotoLibraryButtonOnClickListener( v -> {
    ...
});
screen.setCloseReaderButtonOnClickListener( v -> {
    ...
});

Last update: August 12, 2020