Android open source library uses ZXing open source library to realize QR code function

The QR code function is very popular now, and many products will need a function of scanning the QR code. Here, we record the compilation and running process of Google's ZXing open source library, which is the most used, for your reference;


1. Now Google's ZXing open source library code has been migrated to GitHub, open the hosting address , there is a link below, it is the development instruction guide page , we can directly refer to this page to use, but this guide is not too detailed, or continue to look down;

2. We first clone the project and decompress it to get the following folder;


3. Then we need to install the Maven compilation environment, download Maven and install it; for example, select the compressed package " apache-maven-3.3.9-bin.zip ", after downloading, unzip it, and configure the /bin directory to the Path environment variable; Finally, open the console cmd and run "mvn -v" to see if the Maven environment is normal;


4. After the Maven environment is ready, we enter the root directory of the project through the console and execute the command: mvn package  -Dmaven.test.skip =true to start compiling, the compilation time may be long, you need to download the dependent library, and wait patiently; 


5. After the compilation is completed, we can directly import the project in the /android directory through Eclipse. At this time, the project should be complete (if it is a jar package, you can go to the zxing-BS-4.7.5\core\target directory to find core -3.2.2-SNAPSHOT.jar, you can import this jar package into the project);



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325901544&siteId=291194637