Skip to content

API Integration Documentation For Android

Nichole Martinez edited this page Dec 9, 2022 · 1 revision

This documentation is intended to guide how to integrate smartscanner core in to your android project

*Note : *

Before proceeding make sure you have already perform this https://github.com/newlogic/smartscanner-core/wiki/Building-from-source (TODO maven repo)

QR Code

  1. create an intent w/ SmartScannerActivity
  2. prepare ScannerOptions
  3. then launch ActivityForResult
val intent = Intent(this, SmartScannerActivity::class.java)
val scannerOptions = ScannerOptions(
                mode = Modes.QRCODE.value,
                language = Language.EN,
                qrCodeOptions = QRcodeOptions(isJson = true),
                config = Config(
                    branding = true,
                    imageResultType = ImageResultType.PATH.value,
                    label = "testing",
                    isManualCapture = false,
                    orientation = Orientation.PORTRAIT.value
                )

            )

intent.putExtra("scanner_options", scannerOptions)
  1. Handle result and get intent extra eg.
val result = intent.getStringExtra(SCANNER_RESULT)
val rawResult = intent.getStringExtra(SCANNER_RAW_RESULT)

QR Scanner Result REFERENCES :

  • SmartActivity.SCANNER_RAW_RESULT // [String] Raw content from the QR Code scanner
  • SmartActivity.SCANNER_RESULT // [String] A Json encoded result from JWT
  • SmartActivity.SCANNER_FAIL_RESULT // [String] the fail text message
  • SmartActivity.SCANNER_SIGNATURE_VERIFICATION // [Boolean] JWT is verified or not
  • SmartActivity.SCANNER_JWT_CONFIG_UPDATE // [Boolean] JWT payload is for config update
  • SmartActivity.SCANNER_HEADER_RESULT // [String] A header result after getting result from JWT

Barcode Scanner

TODO barcoder scanner

PDF417 Scanner

TODO PDF417 scanner

IDPASS lite

TODO IDPASS scanner

MRZ Code

TODO MRZ scanner

E-passport/ID Card (NFC) Scanner

TODO E-passport/ID scanner