Open Lukas-Werner opened 3 years ago
Older versions of the library are not supported - please use the latest version (currently 4.3.0).
Hi @rkistner , thanks really much! Where can I see what the latest version for embedded and core is right now? Thanks in advance. Best regards,
Latest versions are in the Readme and the Releases page.
For zxing:core
, the releases are listed on https://github.com/zxing/zxing. But you also don't need to specifically include this unless you set { transitive = false }
.
Alright thanks very much for your support! Now it's recommended to use
// Register the launcher and result handler
private final ActivityResultLauncher<ScanOptions> barcodeLauncher = registerForActivityResult(new ScanContract(),
result -> {
if(result.getContents() == null) {
Toast.makeText(MyActivity.this, "Cancelled", Toast.LENGTH_LONG).show();
} else {
Toast.makeText(MyActivity.this, "Scanned: " + result.getContents(), Toast.LENGTH_LONG).show();
}
});
// Launch
public void onButtonClick(View view) {
barcodeLauncher.launch(new ScanOptions());
}
this method instead of Intents right?
Yes, that's recommended now, in line with onActivityResult
being deprecated. But the previous IntentIntegrator
/ onActivityResult
workflow should still continue working.
After scanning a QR Code I want to save the exact same QR-Code as scanned before. Please see an example of my code from my MainActivity below:
So I'm seeing that the results I receive from scanning QR Codes are correct but I am not able to save the picture with
getBitmap()
as shown in the closed Github-Issue 143:I use these dependencies in my build.gradle file:
implementation 'com.journeyapps:zxing-android-embedded:3.0.3' implementation 'com.google.zxing:core:3.4.1'
Thanks for the great library guys!