Reading barcodes with android
Solution 1
Android programs can interact with eachother using intents. Intents are a little like remote procedure calls: you ask the other program for a certain action (e.g. scan a barcode) and the other program will perform this task for you. The result is returned when the task is complete.
If the user has installed the ZXing Barcode Scanner, you can just use an intent to scan a barcode. The Barcode Scanner will then start, let the user scan the code and return the result to you.
More information about this scanner can be found on the Google Code page of this project: http://code.google.com/p/zxing/wiki/ScanningViaIntent
Solution 2
I'd look at this open source Android project: http://code.google.com/p/zxing/
Solution 3
For fellow Google search travelers, there is a 2012 post on the android developers blog on how to use intents with the example of barcode scanning :
http://android-developers.blogspot.com/2012/02/share-with-intents.html
user233354
Updated on September 27, 2020Comments
-
user233354 over 3 years
Hi I am developing an application for the android htc hero. I am looking into ways of using the inbuilt camer to read 2D barcodes and extract the string returned from the barcode. I have only recently begun working with the android sdk but I do have a programming background from working on projects with java. I am curious to know what the best way to read the 2D barcode would be. I have some sample applications that read the barcode but they are all .apk files and have no source or library that i can work with. to give you a better idea of what i am trying to accomplish this site allows the generation of 2d barcodes made up of the data you desire here
Any replies would be greatly appreciated.
-
Roman Nurik about 14 yearsAnd here's a doc that explains how to programmatically test for an activity that can handle an intent: developer.android.com/resources/articles/…, and if you want to direct the user to download the Barcode Scanner app, this doc has an overview on the URIs to use: developer.android.com/guide/publishing/…
-
Piskvor left the building almost 14 yearsThat is not necessary: as long as you can make a horizontal line through all the bars, the barcode doesn't have to be horizontal - the bars will be wider in absolute numbers, but the relative widths of bars and spaces will remain unchanged. In other words, you can correctly scan even rotated or skewed barcodes.
-
Akh over 12 yearsIs there a way to integrate the Zxing within my android app so that the users dont have to install Zxing BarCode Scanner separately?
-
CoronaPintu almost 11 yearsi had check but how can i intigrate this api in my application i want to read barcode anc return value in my apps
-
patel over 10 yearsI want to scan using Built-in G-sensor, not using camera. Zxing is very useful library when we want to scan using phone camera. I am using iData95E device which provide built in laser scanner. anybody can help me for it.
-
wtsang02 about 8 years@AKh This might help build your own client with Zxing another post