How do I integrate barcode scanning in our app?

Source: Internet
Author: User

Now many apps have barcode scanning function, some phone such as a meter in the camera integrated barcode scanning function, but there are some phones do not have such integration, such as a South Korean star, you need to download a barcode scanning app. Today we'll see how to integrate a barcode scanning feature into your app.

This article source http://download.csdn.net/detail/u012702547/9101419

First Look at Zhang:

It is obviously unrealistic to develop a barcode scanner yourself, and we can use the open source control zxing on GitHub to implement such a feature.

Use zxing of course to download first: https://github.com/zxing/zxing

The use of zxing requires a dependency package: Http://pan.baidu.com/s/1o67qQZC

After the download is done, unzip the first file Zxing-master.zip:
The directory is as follows:

Here are a lot of platform code, we need to be Android platform, open this folder:

The things in these four files we're going to merge into the new project in a second.

Well, after the preparations are done, a new Android project called Zxing, copies the jar files downloaded above to the Libs package, and copies the code above.

Attention:

Here are some of the files are internationalized, copy the time can be directly removed, so to copy the things are very few, and some files are not simple copies, such as values in the String.xml will be merged, not rough coverage of the original file.

After the copy is complete you will find the code is a mess, this time will slowly change, first re-import r files, and then the re-import of various packages. Here I will not say more, no difficulty, is the guide package of things. All of the code errors are resolved after the modification of the manifest file, according to our down the file modified on the line. After the modification, all the activity registration of the place to be changed to full name, can not be omitted, because our registration must be the original file with the package name is not the same.
After these things are done, the project should look like this:

Well, don't wait any longer, run your barcode scanning artifact now.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced. If there is a wrong place, I would appreciate it if I could criticize it.

How do I integrate barcode scanning in our app?

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.