Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate a QR Code for an Android application? [closed]

I need to create a qrcode in my android application, and I need a library or source code that lets me create a QR Code in an Android app.

The library I need must:

  1. not leave a watermark (like onbarcode library)
  2. not use web service API to create the qrcode (like Google's library zxing)
  3. not need 3rd party installers (like QR Droid)

I already created such code for iPhone (Objective-C) but I need a quick fix for Android until I have time to make a QR Code generator of my own. It's my first android project so any help will be appreciated.

like image 683
Radu Avatar asked Jan 10 '12 09:01

Radu


People also ask

Can Android scan QR code without app?

Google Screen Search: Google Screen Search allows consumers to scan QR Codes without an app instantly. All one has to do is point their camera at the QR Code, long-press the Home button and click on 'What's on my screen? ' The QR Code link will be available for consumers to open.

Does generated QR code expire?

No, QR codes do not have an expiration date. The QR code has a Quick Link behind it. As long as the Quick Link is active, the QR code will continue to work.


1 Answers

with zxing this is my code for create QR

 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);             }         }         ((ImageView) findViewById(R.id.img_result_qr)).setImageBitmap(bmp);      } catch (WriterException e) {         e.printStackTrace();     } 
like image 78
Stefano Avatar answered Sep 20 '22 12:09

Stefano