private void generateQR() {
String txt = "Thinesh";
MultiFormatWriter writer = new MultiFormatWriter();
try {
BitMatrix matrix = writer.encode(txt, BarcodeFormat.QR_CODE, 800, 800);
BarcodeEncoder encoder = new BarcodeEncoder();
Bitmap bitmap = encoder.createBitmap(matrix);
imgQrCode.setImageBitmap(bitmap);
} catch (WriterException e) {
e.printStackTrace();
}
}
0 Comments