So I'm another unlucky android development beginner who needs to have ZXing barcode scanner embedded in his app.
There is plenty of questions asking how to do this here on stackoverflow but none of them has an answer that is really understandable and explanatory for a beginner. All the answers say something like "all you have to do is build the core lib of ZXing project, reference it your project and then copy some code from the ZXing's android/directory to your app and you're done". But this is not very helpful for a noob.
I have ZXings core library referenced in my project. I have the Barcode Scanner app source open. I'm trying to read and understand the code of Barcode Scanner app but it is too complex for my level of knowledge.
I just want to have a button in my app that, when pressed, opens a barcode scanner, the scanner should only be able to scan a barcode, decode it and return me the numbers, it doesn't need to send the code anywhere to get any info etc, ill take care of these things myself. I just need a simple scanner that starts on button click, scans the code and gives me the result. But i can't figure how to do it myself.
I assume this shouldn't be hard to do if you only need to copy some text from the ZXing scanner, you just need to understand its code.
So if someone can explain this (tell which parts of code to copy, how to start the scanner in a buttons onClick method etc) please do so, I'm sure there's plenty of people who will be really thankful for this just as i will be.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…