Generation method of QR code in Android (ordinary QR code, central logo QR code, and scanning and parsing QR code)

First of all, we use Google's open source framework zxing throughout the article. There are three functions to be realized: generate ordinary QR code, generate QR code with center image logo, scan and analyze QR code, and directly go to the renderings

First, we need a zxing package like this

Next, you need to introduce resources

1. The picture navbar.png is introduced into drawable

2. Introduce camera.xml, main.xml and QRcode into layout_ capture_ page.xml

3. Create the raw folder and add beep.ogg scanning sound

4. Merge color.xml and copy ids.xml into the values directory

The effect picture after importing the file is like this

Next is the qrcodeutil class

The comments are very clear. I won't talk more about this tool class. Let's talk about calling. Of course, it's also very simple

It's not much to say here. If you can't find the above resources, you can download my source code, which is all there..

Click to download the source code

The above is the generation method of two-dimensional code in Android introduced by Xiaobian (ordinary two-dimensional code, central logo two-dimensional code, and scanning and parsing two-dimensional code). I hope it will be helpful to you. If you have any questions, please leave me a message, and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>