I am building a application to read vin number barcodes using camera from android phone.I do not know how to read the barcodes from the image captured from the camera.(i.e) Is there any class to read the barcode of vin number format.I have tried zxing and other libs no use for me.Thanks
Note: I tried searching in DDG.gg and Stackoverflow but no proper solution.
I have successfully used zxing's source code to decode to valid VIN strings and encode VIN strings back into barcodes via intent (with a little help).
Here's the key -
Integrate your zxing source code as a library. Here is the step-by-step link:
http://damianflannery.wordpress.com/2011/06/13/integrate-zxing-barcode-scanner-into-your-android-app-natively-using-eclipse/
Note, there is also a nice discussion here as to why this should not be done from a developer's standpoint, but the code is free-open-use and we need to modify it in a fashion that cannot currently be done via intent. So on we go.
In your project, call zxing via intent (just as they recommend); specify
intent.putExtra("SCAN_MODE","ONE_D_MODE");
I have actually had it work both ways (with and without this line) but it's up to you if you see better results including it. I usually get a VIN to scan in less than 1/4 second of focus once it's in frame.
Preview resolution matters, as the camera preview sends frames to the decoder to search for a valid barcode.
so... in CameraConfigurationManager.java, specify a larger
MAX_PREVIEW_PIXELS
(that does not exceed your screen resolution). I used "1024 * 600" - my devices resolution. This may take some tweaking.in CameraManager.java, edit your framing rectangle to widen for the size of the larger barcode, via
private static final int MAX_FRAME_WIDTH = screenpixelsinteger;
, mine is 1000.in
public Rect getFramingRect() {
, editint width
to be= screenResolution.x * 1
(or* nothing
), instead of* 3 / 4
. This will widen the framing rectangle to be as wide as the screen resolution, but no wider thanMAX_FRAME_WIDTH
specified above (it will be clamped if the MFW is lower).Finally, SCAN!
I don't believe I've edited any other variables, but if I find that I did to make this work, I will update this answer.