cover

Enable VIN Scanning on Android

What is a VIN? #

A VIN (Vehicle Identification Number) is a unique code used to identify individual motor vehicles. It consists of 17 characters, which include both digits and capital letters, and it provides information about the vehicle's manufacturer, model, and serial number. 

The VIN (Vehicle Identification Number) feature is designed to scan barcodes specific to vehicle identification.

How to enable VIN on Android? #

It can be enabled either via a pre-defined template or manually.

For the pre-defined template, the system's BarkoderHelper applies the VIN template to the configuration. The Region of Interest (ROI) is set to capture the entire viewfinder (a rectangle sized 100x30 starting at the top-left corner).

For manual setup, the system enables Code39Code128DataMatrix, and QR decoding because all of those barcode types can be used as VIN. The decoding speed is set to slow (for better results), and the barcode resolution is set to high. Again, a ROI is set similar to the pre-defined template.

In both methods, the license key must be valid, otherwise, the results will contain asterisks.

Set it via pre-defined template: #

                private fun setVinMode() {
    bkdView.config = BarkoderConfig(this, "LICENSE_KEY") {
        Log.i("Licensing SDK: ", it.message)
    }

    BarkoderHelper.applyConfigSettingsFromTemplate(this, bkdView.config, BarkoderConfigTemplate.VIN,
        object : BarkoderConfigCallback { // This is sync callback
            override fun onSuccess() {
                bkdView.config.isRegionOfInterestVisible = true
                bkdView.config.setRegionOfInterest(0f, 30f, 100f, 40f)
            }

            override fun onFail(p0: BarkoderException?) {
                TODO("Not yet implemented")
            }
        })
}
            

Set it manually: #

                private fun setVinMode() {
    bkdView.config = BarkoderConfig(this, "LICENSE_KEY") {
        Log.i("Licensing SDK: ", it.message)
    }

    // Enabling code39, code128, datamatrix and qr
    bkdView.config.decoderConfig.Code39.enabled = true
    bkdView.config.decoderConfig.Code128.enabled = true
    bkdView.config.decoderConfig.Datamatrix.enabled = true
    bkdView.config.decoderConfig.QR.enabled = true

    // For best result decoding speed should be slow, and barkoder resolution should be high
    bkdView.config?.decoderConfig?.decodingSpeed = Barkoder.DecodingSpeed.Slow
    bkdView.config?.barkoderResolution = BarkoderResolution.HIGH

    bkdView.config.isRegionOfInterestVisible = true
    bkdView.config.setRegionOfInterest(0f, 30f, 100f, 40f)
    bkdView.config.decoderConfig.enableVINRestrictions = true
}
            

Page Contents

History:

close