Skip to content Skip to sidebar Skip to footer

How To Store The Generated Qr-code As An Image In Sdcard (zxing Library)

I m making an app based on QR code. I have to Generate a QR-Code of a specific String and also I have to save the generated QR-Code in SD card. is it possible using the Zxing Libra

Solution 1:

You can't cause the image to be saved, or get the image back, if you're integrating by Intent. However the user can save the image by pressing Menu and Share.

Instead you will simply need to embed the core library from the project and call it to encode the image. Then you can display or save or do what you like.

You can see how it's done in the app here, and reuse parts of this code: https://code.google.com/p/zxing/source/browse/trunk/android/src/com/google/zxing/client/android/encode/EncodeActivity.java

Solution 2:

Complete Answer:

Text is a great Java PDF library. They also have an API for creating barcodes. You don't need to be creating a PDF to use it.

This page has the details on creating barcodes. Here is an example from that site:

BarcodeEANcodeEAN=newBarcodeEAN();
codeEAN.setCodeType(codeEAN.EAN13);
codeEAN.setCode("9780201615883");
ImageimageEAN= codeEAN.createImageWithBarcode(cb, null, null);

The biggest thing you will need to determine is what type of barcode you need. There are many different barcode formats and iText does support a lot of them. You will need to know what format you need before you can determine if this API will work for you.

Solution 3:

hmm! ok then see this link. in this link the ZXing library is used! and it is described simply! http://www.mysamplecode.com/2012/09/android-generate-qr-code-using-zxing.html

let me know is it usefull?

Post a Comment for "How To Store The Generated Qr-code As An Image In Sdcard (zxing Library)"