4

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.

Community
  • 1
  • 1
Jatin
  • 1,668
  • 2
  • 16
  • 23
  • Zxing is opensource library project so there is no harm in integrating with your app without installing the zxing demo app. – Ashwin N Bhanushali Mar 30 '12 at 08:29
  • @Android_crazy I have actually tried integrating it and I aslo managed to fix all the errors too but then after integrating into my project and extending Capture activity I get another set of errors in regards to result - I followed the instructions mentioned here - http://www.androidaz.com/development/zxing-qr-reader-direct-integration before integrating - Can you help me with this. Thanks – Jatin Mar 30 '12 at 10:18
  • 2
    @Android_crazy It's dangerous to suggest that if it's open source you can do what you like with it. You can't; open source licenses still have terms. For example, ShopSavvy was nearly taken to court for repeatedly ignoring zxing's project's license terms, presumably because they thought this way. http://osdir.com/ml/zxing/2010-10/msg00196.html – Sean Owen Mar 30 '12 at 12:22
  • Thanks For bringing this in my notice. – Ashwin N Bhanushali Mar 30 '12 at 12:44
  • 2
    I'm voting to close this question as off-topic because it is asking for legal advice. –  May 25 '15 at 04:28

2 Answers2

7

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:

  • People usually copy AndroidManifest.xml and its declarations. This makes the clone app respond to Intents that were meant for the Barcode Scanner app. It inconveniences or breaks the user experience for our app and others. Not good at all.
  • Copying the familiar project UI will make people think they're using Barcode Scanner when they're not. There is a potential legal issue of trademark here if your product is confusingly similar to another. The open source license does not grant trademark rights.
  • Your app issues may get reported to us as project bugs as a result. Developers asked to do this embedding sure do ask for a lot of help on the mailing list too. That harms the overall community by making others support your app.

The usual reasons given for doing such copying are:

  • It's a better user experience to embed the scanning. Maybe so, but, you can write your own scanning app, or at least your own UI. I am not sure it is a better user experience either. For example, if using Intents, your users can scan with better specialist apps that you don't have access to, like Barcode Scanner+ or Goggles.
  • My company won't let me use a third-party app. Maybe, but it's just identifying someone else who's making the decision, not justifying it. If it's for 'security' reasons -- these apply equally well to embedding third-party code.

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.

Sean Owen
  • 66,182
  • 23
  • 141
  • 173
  • Thanks for your reply. I have fully understood the issues with the question I asked earlier but can you guide me towards building a Qr Barcode scanner from scratch without using any library. It would be something like showing a camera on a button click listener and then I would perform some calculations to recognise the qr code. I just need a starting point in this direction. Do you know where I could make a start. Thanks – Jatin Mar 30 '12 at 12:30
  • @Sean Owen Interesting http://code.google.com/p/zxing/wiki/LicenseQuestions I just read the apache license and what I only understand is to somehow add http://code.google.com/p/zxing in about or help page. I'm confused on how to add the apache license v2.0, is it inside the code? a pop.up before proceeding to my application? Because I am currently using the zXing library, Im planning to creat e a scanner that can scan more than one qr code in one image, Yes I did use the multiqrcode class for that. Haven't used the UI though, I created my own, mostly only the classes, but did not modify. – She Smile GM Feb 13 '13 at 03:16
  • The page answers your question in the first section on how to comply. The license itself actually answers that too. – Sean Owen Feb 13 '13 at 08:26
5

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:

  • The user has access to the new Zxing app updates immediately without being dependent on me.
  • Zxing when launched via intent does not show any branding - so any client that has brand awareness issues should be happy.
  • Apart from having to install Zxing if it is not already, the intent method works from a user perspective exactly the same, assuming you launch the scanner in full screen mode as it is by default.

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

Graham Smith
  • 25,627
  • 10
  • 46
  • 69
  • Thanks for you reply and your time. From what you have mentioned I have understood that even if I go with the integration of the apps then every time an update is published for Zxing, my app will stop working? and I will have to update the code and republish my app? AM I right? Thanks – Jatin Mar 30 '12 at 09:10
  • not quite- but that maybe my explanation not you. It will continue to work fine. But lets say a new barcode comes out, the QR 5000, your app will not be able to scan it however the new Zxing does. You will then have to integrate the new version into your own app and then publish an update. – Graham Smith Mar 30 '12 at 09:12
  • Thanks for your time mate - Do you know anything apart from zxing I could use? – Jatin Mar 30 '12 at 10:13
  • I looked for a while but I found other projects to be not quite as mature or they wanted some of my money -the horror-. If you like the answer then could you upvote/accept it, so I may receive some lovely rep. – Graham Smith Mar 30 '12 at 10:15