i went throght this web site
https://github.com/journeyapps/zxing-android-embedded[
^] and have implemented a barcode scanner. but i am not able to fetch the value after it has been scanned
the code i used to implement the scanner is as follows
IntentIntegrator integrator = new IntentIntegrator(MainActivity.this);
integrator.setDesiredBarcodeFormats(IntentIntegrator.ALL_CODE_TYPES);
integrator.setPrompt("Scan a barcode or QR Code");
integrator.setCameraId(0);
integrator.setBeepEnabled(false);
integrator.setBarcodeImageEnabled(true);
integrator.initiateScan();
in onActivityResult
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
if(result != null) {
if(result.getContents() == null) {
Toast.makeText(this, "Cancelled", Toast.LENGTH_LONG).show();
} else {
Toast.makeText(this, "Scanned: " + result.getContents(), Toast.LENGTH_LONG).show();
}
} else {
super.onActivityResult(requestCode, resultCode, data);
}
}
on running the app i get an error
Error:(50, 52) error: package com.google.zxing.client.androidlegacy.camera does not exist
i have imported the following library into my gradle file
compile 'com.google.zxing:core:3.2.0'
compile 'com.journeyapps:zxing-android-embedded:3.0.3@aar'
now how do i fetch the scan value? please guide me to achieve this