Android Two-dimensional code function implementation: Embedding zxing projects within the program

Source: Internet
Author: User

The recent two-dimensional code is really getting more and more hot, casual TV, online, shopping malls, everywhere are two-dimensional code. and embedded two-dimensional code scanning software is more and more, QQ, micro-letter, UC Browser and so on applications can sweep a two-dimensional code scan, feel our own application without two-dimensional code scanning function, are not up to the trend of the times. So today I'm going to take you along and add two-dimensional code scans to our own programs.

However, two-dimensional code features if you really want to do is still very complex, starting from scratch is not very realistic, the better way is to rely on existing open source projects. Currently in the field of two-dimensional code is the most famous open source project is zxing (Zebra crossing), it provides a number of platforms two-dimensional code scanning solution, open source project address is https://code.google.com/p/zxing/.

Although there are already open source projects on the Internet, however, the documentation and tutorials on zxing seem to be relatively few, so there are many friends do not know how to introduce zxing in the project, here I take you step-by-step realization, I believe that everyone after reading this article can be in their own The two-dimensional code scanning function is implemented in the project.

First, we need to download the source of the jar package that the Zxing project relies on.

The download address is Http://repo1.maven.org/maven2/com/google/zxing/core/2.2/core-2.2-sources.jar.

Then we will download the zxing project, the download address is https://zxing.googlecode.com/files/ZXing-2.2.zip.

It is recommended to use Thunderbolt download, because Google Code and MAVEN access in the domestic instability, often broken up, the use of Thunderbolt can guarantee the integrity of the file.

In addition, after my test, in the Zxing project directly import core-2.2 jar package is not functioning, so we can only by adding core-2.2 source code to the Zxing project to achieve. Download the above two files, first extract the Core-2.2-sources.jar file, the directory structure after decompression as shown in the following figure:

And then extract ZXing-2.2 this compression package, which can see a variety of platforms under the Zxing Project source code, we go to the Android folder src directory, the core-2.2-sources in the source copy in. After the copy, the directory structure under the Android folder is shown in the following illustration:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.