You can get FREE JAVA API to generate QR Codes For your java/android application from zxing under License
Steps to integrate Zxing in grails application add below lines in buildConfig.groovy file under conf directory:
1. add respository mavenRepo 'https://oss.sonatype.org/content/repositories/snapshots'
2. add dependency compile ("net.glxn.qrgen:javase:2.0")
3. Now generate QRCodes for free
import java.io.File;
import net.glxn.qrgen.core.image.ImageType;
import net.glxn.qrgen.javase.QRCode;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.FileUtils;
....
....
File file=QRCode.from("Hello World").to(ImageType.PNG).file();
//here we have convert generated image file into a base64 code to store in database.
String imageCode=Base64.encodeBase64String(FileUtils.readFileToByteArray(file));
System.out.println(imageCode);
For more usage visit on kenglxn
Thanks
More From Oodles
Ready to innovate? Let's get in touch
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Deepak Agrawal
Deepak is an bright developer with experience in Groovy and Grails. He is well versed with AngularJS.