I have researched a lot about creating my own app for android with a QR code Scanner & Reader without having to install Zxing app on the phone. I have gone through a lot of questions here too and I have read it is possible via one or all of the following links:-
http://jmanzano.me/integrating-zxing-in-our-own-android-app-barcodescanner/
Integrating the ZXing library directly into my Android application
http://damianflannery.wordpress.com/2011/06/13/integrate-zxing-barcode-scanner-into-your-android-app-natively-using-eclipse/
Is it legal to do it this way or do we have to use intent? Are there any other open source libraries out there apart from zxing where I could use their library to integrate into my project.
I'm the author and the source of most the comments you're asking about. As long as you follow the terms of the Apache License 2.0 (see comments here), you have license to use the copyrighted work of the project for just about any purpose.
I'm not discouraging anyone from reusing the code (in accordance with above), even some from Barcode Scanner, as it is after all open-source and has been given away by the authors to be benefit the community. I am strongly discouraging copying the project substantially in its entirety into an app. There are a few reasons for this:
AndroidManifest.xml
and its declarations. This makes the clone app respond to Intent
s that were meant for the Barcode Scanner app. It inconveniences or breaks the user experience for our app and others. Not good at all.The usual reasons given for doing such copying are:
These reasons tend to boil down to "it will make me less money." I don't think they outweigh the issues above, and certainly do not answer the trademark issue. I have little sympathy for the copycats, especially having seen so many clones in the Market that just add ads, or in one case, malware.
The Zxing team rightly point out that integration into your app by integrating source code is not the best code.
REF: http://damianflannery.wordpress.com/2011/06/13/integrate-zxing-barcode-scanner-into-your-android-app-natively-using-eclipse/
Why?
It means that every time an update is published for Zxing, you will have to copy their updated code and include it within your app, and then publish an update for your own app in turn. There is no guarantee that any updates will be compatible with your current model either.
So that leaves us with intents. See http://code.google.com/p/zxing/wiki/ScanningViaIntent
Zxing have done a great job with this. You have to include a little bit of extra code that elegantly handles the situation if the user does not have Zxing (or an equivalent .e.g. Google Goggles that runs off Zxing oddly enough) installed. It will prompt them to install Zxing if it is not installed and if it is then the app will start.
I personally like this approach because:
I am not saying it is bad to integrate, I am saying it is probably not the best approach. That said we have found situations where we need the scanning built directly into the app. To do this requires some minor amends to the source (changing a few switch statements to if/else).
Is it legal to do it this way or do we have to use intent?
It is open source so you may do it either way in the end. However I hope that my above experience may deter you from integrating their code with yours.
The code is under Apache Licence V 2.0 and you can read the conditions at http://code.google.com/p/zxing/wiki/LicenseQuestions
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With