Sorry if this has been answered before, but I am trying to make an application that will include the ability to scan barcodes on Android. I'm looking at using ZXing as the library, however, I want to embed the scanner in my application so that the user doesn't have to have the ZXing barcode scanner installed to use my application. From the description of ZXing, it sounds like this is possible.
I've gotten as far as building ZXing, linking it into my project in Eclipse, then creating a new reader instance. However, I'm lost when it comes to starting the barcode reader and implementing the callbacks. IMO, this is when the documentation here gets hazy.
If someone could explain how to use ZXing properly, that would be of great help.
Cheers!
Personally, I'm a fan of using multiple apps as plug-ins. That way, the user doesn't have to have the same code on the phone multiple times (storage is limited, after all), and - more importantly - if ZXing improves the barcode scanner (which they do often), the user will automatically have the latest and greatest version without you having to integrate and modify it again to fit your needs.
You can simply detect for the presence of the app, and prompt the user to install it if it doesn't exist. You can simply link to the pname: Uri to the zxing app, which will automatically fire up the market and allow the user to install the app.
That said, if you really want to embed the code, one way would be to download the relevant source files, rename the package names and intent names so they don't clash with ZXing's code, and then simply call the intent to scan the barcode (like you would normally do when you use the barcode scanner as a plug-in). If you do that, be sure to credit ZXing for their work in your documentation, and make sure their terms of service allow for using and modifying their source code.
Complete source code to Barcode Scanner is in the android/ directory. That is about the best explanation you could ask for.
If you're rewriting it with new code for your own purpose, I think that's more up to you than for the project to explain.
You might get more useful information at the project discussion group.
Related
I'm working on a project which will to scan pdf417 barcodes, am developing this application using Rhodes specially for Android and iPhone. As I came to know that Zxing is one the useful api to scan pdf417 barcode for Android.
Can we Integrate Zxing with Rhodes ?
What is the procedure?
Please let me know if anyone gone through this.
-Thanks.
Rhodes uses Zxing in its Barcode class (http://docs.rhomobile.com/en/5.0.38/api/barcode), so there is support out of the box for some of Zxings features. For example for QR Codes and Code128 it works right away. However, not all types of Barcodes are supported on all platforms, so you should try out if pdf417 is supported on Android and IOS.
If it is not you can still write a native extension. It's actually not that hard. The documentation is relatively good (http://docs.rhomobile.com/en/5.0.38/guide/native_extensions). However, in my opinion it misses how to start and return to activities (via startActivity or startActivityForResult). But luckily the source code of how they implemented the Barcode class is open (https://github.com/rhomobile/rhodes/blob/3-5-stable/lib/extensions/barcode/ext/barcode/platform/android/src/com/rhomobile/barcode/Barcode.java) so you can take it as a basis for your own native extension with a scanning engine which supports pdf417.
I am looking at making use of QR codes in an application of mine.
I did some research / Googling and I found that this library is apparently a good option to use:
http://sourceforge.net/p/zbar/news/
But I read there it says that is still needs an application that can read qr codes for it to work?
Is there not a library that just makes use of the camera and then decodes the qr code in the application that is using the library?
If you need to scan QR codes in your application, this is the way to go :https://code.google.com/p/zxing/
You can also integrate the necessary libraries in your project in order to avoid to launch a scan using the Intent way (so a third-party app installed on your device would be necessary).
If you Google it, you'll find a lot of guides to do that: the first I got is http://www.androidaz.com/development/zxing-qr-reader-direct-integration but there's a plenty of tutorials out there.
ZBar can be installed as a library in the project, and used as any other activity.
You can Check:
https://github.com/DushyanthMaguluru/ZBarScanner/blob/master/examples/ZBarScannerDemo/src/com/dm/zbar/android/examples/MainActivity.java
That's the example of how to use ZBAR to read a QR, in the onActivityResult you can handle the results (in this case the example makes a toast).
You can follow the installation explanation here:
https://github.com/ZBar/ZBar/tree/master/android
I'm beginner in android and I need to create own QR code scanner app.
After searching for some library, of course I found zxing library (http://code.google.com/p/zxing/), but if I understand right, there must be installed BarcodeScanner application to use it and this library call this app. This variant is bad for me, because I need only my own app.
But if I'm not right, how to use this library without installing BarcodeScanner?
Also I found this: http://www.blackdogfoundry.com/blog/zbar-bar-code-qr-code-reader-android/, and I'm not sure that it will work fine with all devices.
Did anyone do some qr readers, what did you use? Do you know some other good libraries for this, except of zxing?
ZXing is good and useful library. I think you are mixing up library itself and application
which is also produced by the project
I wouldnt be so quick to dismiss Barcode Scanner.
I recently used it in an App that needed to read barcodes. It works seamlessly with my App. The only downside is that it needs to be installed by the user, but to be honest weighting that up against the time and money it would take to develop a Barcode reader from scratch, its a no brainer. If the user does not have it installed it will not break your app.
I know this is not the answer you were looking for but just thought I would offer my experience
You may also try to call the BarCode scanner App and obtain the result in the parameter of strings rather than importing the whole zxing library into your project due to substantial cost to code integration into your project . Using intents and overriding the OnActivityResult is already a good solution.
XZing is your answer!
yeah yeah they try to push it to use as an external library, but that relies on the user having it installed.... but it's all open source and you can use it however you prefer.
So download that code, integrate it directly into your app and there you go.
I am trying to do an app to create a final QR code for the information of multiple barcodes
that I have scanned.
I am wondering how would you import the ZXing lib to your code?
Assume that user already has ZXing scanner in their mobile, can I just connect with the app to generate the barcode without importing all the lib since it will make my app heavy?
For importing , QRencoder.java from ZXing, what are the necessary part of codes that I need?
Or is it even possible?
I found this two months ago : http://damianflannery.wordpress.com/2011/06/13/integrate-zxing-barcode-scanner-into-your-android-app-natively-using-eclipse/
And I have tried installing that apache but it is so painful process for me. So is there any other ways around?
Regards
Thet
Yes, just use Intents. You don't need any code beyond the bit of integration code here: http://code.google.com/p/zxing/wiki/ScanningViaIntent The same class has methods for encoding a barcode on screen.
alright so I've searched for quite sometime on this and I can't seem to find just the kind of answer that answers my questions...so here goes nothing! And mind you, I'm new to android dev soooo I may have stupid questions that some of you may get irritated at, but we all have to learn some how right?
I'm trying to develop an application that will allow users to scan in a QR code and then display the information that is encoded into it in a nice organized way.
It seems like ZXing doesn't like the idea of integrating their code with other applications e.g. you have to use their application from the market and point to it via intents... well if I do it this way, can I decode the contents so that I can have access to the content and do as I want with it?
What would I have to include in my project from the ZXing folder that I downloaded to make it all work? And would I have to build all of the objects with in that folder in order to use them in my project?
Any help would be greatly appreciated. Thanks!
I have decided to go other routes.
The "Android way" is to do everything via intents.. However, zxing is a special case. You can follow the intent route, or you can (as it's apache licensed), download the source code and adapt as necessary. We did that for the game Barcode Beasties ( mandatory self promoting download link here : https://market.android.com/details?id=com.fawepark.android.barcodebeasties ) and that meant we could also brand the scan page as well.
If you want use the software integrated, then just download the source and either compile it as a library or just include it in your source folder as another folder.