I am trying to create a QR that, when read by another device, appears as creating a new Contact.
To create the QR, I have tried the class QRCodeWriter and BitMatrix.
I leave you the code:
QRCodeWriter writer = new QRCodeWriter();
try {
BitMatrix bitMatrix = writer.encode(content, BarcodeFormat.QR_CODE, 512, 512);
int width = bitMatrix.getWidth();
int height = bitMatrix.getHeight();
Bitmap bmp = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
bmp.setPixel(x, y, bitMatrix.get(x, y) ? Color.BLACK : Color.WHITE);
}
}
image.setImageBitmap(bmp);
} catch (WriterException e) {
e.printStackTrace();
}
}
And I would like that when reading the QR, something similar to this would come out