如何生成QR $ C $下一个Android应用程序?应用程序、QR、Android

2023-09-12 10:45:17 作者:赐我一男神白首不分离

我要在我的Andr​​oid应用程序中创建一个QR code,我需要一个库或源$ C ​​$ C,让我在一个Android应用程序创建一个QR code。

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.

我需要必须将库:

在不留水印(如的OnBar code 库) 在不使用Web服务API创建QR code(如谷歌图书馆zxing) 在不需要第三方安装程序(如QR Droid的) not leave a watermark (like onbarcode library) not use web service API to create the qrcode (like Google's library zxing) not need 3rd party installers (like QR Droid)

我已经创造了这样code的iPhone(Objective-C的),但我需要为Android速战速决,直到我有时间让我自己的QR code发电机。这是我的第一个Android项目,所以任何帮助将AP preciated。

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.

推荐答案

你有没有看着 ZXING ? 我一直在使用它成功地创造吧codeS。 你可以看到在比特币的应用程序的src

Have you looked into ZXING? I've been using it successfully to create barcodes. You can see a full working example in the bitcoin application src

// this is a small sample use of the QRCodeEncoder class from zxing
try {
    // generate a 150x150 QR code
    Bitmap bm = encodeAsBitmap(barcode_content, BarcodeFormat.QR_CODE, 150, 150);

    if(bm != null) {
        image_view.setImageBitmap(bm);
    }
} catch (WriterException e) { //eek }