Exchange

QR Code Generate in Android Studio

 


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();
}


}



Post a Comment

0 Comments