I want to share a simple string between two android devices with QR code.
For Scanning the code i use google mobile vision API, but what's the best way to generate it?
All libraries that i found such as Zxing are old and no longer maintained.
I want to share a simple string between two android devices with QR code.
For Scanning the code i use google mobile vision API, but what's the best way to generate it?
All libraries that i found such as Zxing are old and no longer maintained.
You can use library by androidmads/QRGenerator Backed by Zxing but continuosly maintainted and support.
implementation 'androidmads.library.qrgenearator:QRGenearator:1.0.4'
implementation 'com.google.zxing:core:3.3.2'
QRGEncoder qrgEncoder = new QRGEncoder(inputValue, null, QRGContents.Type.TEXT, smallerDimension);
qrgEncoder.setColorBlack(Color.RED);
qrgEncoder.setColorWhite(Color.BLUE);
try {
// Getting QR-Code as Bitmap
bitmap = qrgEncoder.getBitmap();
// Setting Bitmap to ImageView
qrImage.setImageBitmap(bitmap);
} catch (WriterException e) {
Log.v(TAG, e.toString());
}
QRGSaver qrgSaver = new QRGSaver();
qrgSaver.save(savePath, edtValue.getText().toString().trim(), bitmap, QRGContents.ImageType.IMAGE_JPEG);