Search code examples
androidkotlinbarcode-scannergoogle-mlkit

ml-kit - barcode-scanning android - Google code scanner


I am using Google code scanner Android MLKit for Barcode scanning. I am using below dependencies. I want the use bundled model so that initialisation time is not taken when app is launched. Is there a way can I use bundled version of model :

Please find below dependencies I used for this :

implementation 'com.google.android.gms:play-services-code-scanner:16.0.0'

AndroidManifest:

When I used the above dependencies , I see below exception during downloading the model: Waiting for the Barcode UI module to be downloaded.

Is there a way can I use bundled version of model so that I need not wait for Barcode UI module to be downloaded. Please help me regarding this

Thanks in Adavance.


Solution

  • What about this:

    dependencies {
      // ...
      // Use this dependency to bundle the model with your app
      implementation 'com.google.mlkit:barcode-scanning:17.1.0'
    }
    

    Found at: https://developers.google.com/ml-kit/vision/barcode-scanning/android