生成QR code在Android中使用Java [英] Generating QR code in Android using Java

查看:129
本文介绍了生成QR code在Android中使用Java的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道如何使用Java程序生成QR code?我需要一个应用程序生成QR code对于给定的细节的Andr​​oid设备。谢谢!

Does anyone knows how to generate QR code using Java program? I need to make an application to generate QR code for given details to Android device. Thank you!

推荐答案

尝试ZebraCrossing(ZXing),它看起来很不错:的 HTTP://$c$c.google.com/p/zxing/

Try ZebraCrossing (ZXing), it looks good: http://code.google.com/p/zxing/

String contents = "Code";
BarCodeFormat barcodeFormat = BarCodeFormat.QR_CODE;

int width = 300;
int height = 300;

MultiFormatWriter barcodeWriter = new MultiFormatWriter();
BitMatrix matrix = barcodeWriter.encode(contents, barcodeFormat, width, height);
BufferedImage qrCodeImg = MatrixToImageWriter.toBufferedImage(matrix);

这篇关于生成QR code在Android中使用Java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆