I use ZXING to successfully encode QR barcodes. However, at least with the current version, it appears to have limited support for encoding other symbologies (for example: PDF-417).
I am using the following code snippet:
// Encode the bitmap and display it on the screen try { // This will produce a 150x150 QR Barcode and display it on the screen. Bitmap bm = encodeAsBitmap(barcodeContentString, BarcodeFormat.QR_CODE, 150, 150); if(bm != null) { barcodeImage.setImageBitmap(bm); } } catch (WriterException e) { ... }
In this example, "barcodeContentString" is the data that is being encoded. "BarcodeImage" is a standard ImageView.
I do not show it here, but I turn on the screen for the entire time that the barcode is displayed. This way, I can successfully scan the barcode using a QR barcode scanner.
source share