Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
What do we have out there available to us (if anything) that we can call for QR data discovery and extraction on an image?
While there have been plenty of posts thus far referencing the ZXing library for QRCode scanning, I haven't found that to be a solution that works for me. Several others have been asking for QRCode scanning alternatives and I have not seen useful feedback. I thought I might ask the community once more what the other options might be for a QR code library that does not launch an activity and call outside our own applications. It should scan images from the Camera2 API in a very simplistic manner. It shouldn't be a complicated library. I hadn't seen examples or individuals speaking of it in this manner.
It actually puzzles me as to why there hasn't been native implementations of the QRCode functionality added into perhaps the Camera library or similar place within the Google SDK natively within the operating system.
Calling and requiring another application (or even requesting a download) is not an elegant solution and no users should be succumbed to doing such thing. As developers we should have access to a library capable of extracting a QRCode from an image or frame that we can then remove encoded data from.
While Sean Owen and others that have worked on the original Zxing library had provided an approach to work with the barcode libraries for the past several years, Google has finally put out an official release with Google Play Services for handling qr and barcodes.
The barcode detection library is described here. The inclusion of these libraries will make for a smooth integration. I'll repost with some sample code for achieving these results from a captured image. At the moment, I wanted to update my answer for this official release. If this indeed does provide a nice way to get at this information (without jumping through hoops and complications), then I'll update with the source and check this off as an accepted answer.
The detection library that Google has provided within the past year has been a much easier library to work with. It allows for quick integration with the camera APIs and extracts the information with simplicity. This would be the component that I would suggest going forward with recognition. A quick snippet is demonstrated below for handling a Qr-code. A handful of pseudocode is left in there as well.
public final void analyzeFrameForQrCode(byte[] qrCodePictureF, int imageFormatF, XriteSize previewWindowSizeF)
{
if(!qrCodeDetectionPossible() || qrCodePictureF == null || mIsAnalyzingQrCodeFrame)
{
return;
}
... //Bitmap conversion code
Frame frame = new Frame.Builder().setBitmap(pictureTaken).build();
SparseArray<Barcode> barcodes = mBarcodeDetector.detect(frame);
if(barcodes != null && barcodes.size() != 0)
{
Barcode qrCode = barcodes.valueAt(0);//barcodes.get(Barcode.QR_CODE);
if(qrCode != null)
{
if(extractInformationFromQrCode(qrCode.rawValue)) {
mIsRequestingBarcodeDetection = false;
vibrateForQrCodeDiscovery();
((Activity)mContext).runOnUiThread(new Runnable() {
#Override
public void run()
{
hideBarcodeDetection(true);
}
});
}
}
}
... //Cleanup and code beyond Qr related material
}
}
There are of course other calls available that can be taken advantage of. But there are really only a couple lines in there. The service for analyzing the frames with the library are not there by default on devices however. So, you should check whether or not the library is available (such as when internet is not available) before calculating as well. This is a slight nuisance of it. I had assumed it would be available as updates for devices going forward as part of the support library or Google Services going out to all devices. But it needs the communication first with an external service to use these library calls. Once it does this one time then that device is good from that moment on.
In my small example, I pop a toast up after a check and then back out of the activity and let the user check their connection. This can be done with a small amount of sample code as well.
if(!mBarcodeDetector.isOperational())
{
updateUserInstructions("The barcode library cannot be downloaded");
return false;
}
Edit (Update):
A considerable amount of time has passed since working with the latest Google Play Services Vision libraries available for barcode detection. While the limitation for needing to download the library over the wifi is indeed a limitation, it is a one time process. And lets be honest...
...our devices will have a connection. The library itself is downloaded in the background so you don't even notice it happening unless there is trouble downloading it and then you would have to report an appropriate corrective measure such as enabling a connection to the internet for it.
One additional tidbit is that it is a little tricky sometimes with how you integrate the library into your application. Using it as a library project worked on some devices and then failed on others. Adding the jar to the build path worked across a broader number of devices (it could be all, but it solved a problem). So as such, I would do it using the secondary method when including it in your projects for now.
Android QRCode Scanner Library
This may help you, this library doesn't require any download or use of any external application. We can directly integrate this into your app and use it for scanning a QR code.
https://github.com/dm77/barcodescanner
This wiki will help you to integrate with your app,
https://github.com/dm77/barcodescanner/blob/master/README.md
You can also check MobileVisionBarcodeScanner (note I'm the author of this package). It is powered by Google's mobile vision API. Also see the overview
here .
I used this library in my app. It also works with xing but you don't need any third party applications. Additional it's really easy to use.
https://github.com/journeyapps/zxing-android-embedded
Maybe you searched something like this.
You've already found the library you're looking for, I think. See the core/ module:
https://github.com/zxing/zxing/tree/master/core
You're just looking at the Intent-based integration, but, in fact the core scanning is its own stand-alone library that you can embed into your own app.
I think Intent-based integration is best in most cases, simply because it is so simple, and, most people don't have the time to reimplement their own scanning UI and such on top of the core. Most devices have Barcode Scanner installed already, so it doesn't usually need a download.
Still, take your pick. That's why there are at least two ways to use it.
Rather than QRCODE ZXing library integration You are able to open camera and scan QRCode from anywhere:
The code i found below will may be helps to you for scanning QRCode :
try {
Intent intent = new Intent("com.google.zxing.client.android.SCAN");
intent.putExtra("SCAN_MODE", "QR_CODE_MODE"); // "PRODUCT_MODE for bar codes
startActivityForResult(intent, 0);
} catch (Exception e) {
Uri marketUri = Uri.parse("market://details?id=com.google.zxing.client.android");
Intent marketIntent = new Intent(Intent.ACTION_VIEW,marketUri);
startActivity(marketIntent);
}
Please remember that You must have a barcode scanner application by "Zxing" in Mobile Phone else it will firstly redirect to Google play store link for download it.
Related
How android camera can be used as scanner to scan the device, like in iOS we have AVCaptureDevice & AVCaptureSession classes.
I have tried following -
1. Open CV - result are not good
2. Suggestion which are already available on Google & stack overflow, but none seems to provide good answer.
Is there some free SDK available which can be used?
OpenCV is very easy as it is free of charge. You can find an example of a place you hang out in the thousands can benefit from your own library.
but you can also use very complicated BoofCV
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
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.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Does anyone know of a good Java Microsoft Office API capable or running on an Android? I know there is an OpenOffice Java API, but I haven't heard of anyone using it on Android.
I know that using intents is another option, but how common are pre-installed office viewers on the varying Android distributions? Would it be reasonable for a developer to expect the user to have one of these viewers installed? Is it reasonable to request that they install one of these applications if they don't already have one?
Since most of the documents we need to display are already hosted on the web, we opted to use an embedded web view that opens the document using google docs viewer.
We still have a few locally stored documents though that this approach doesn't work with. For these, our solution was to rely on the support of existing apps. After spending some more time with Android, It seems that most devices come equipped with some sort of document/pdf reading capability installed fresh out of the box. In the event that they don't have a capable app, we direct them to a market search for a free reader.
Unfortunately there's no built in Android control to edit MS Office files, or even to display them! It's a pretty big omission given iOS has built in support for displaying Office files. There don't seem to be viewer app consistently enough available to rely on (and they may not provide the kind of user experience you're hoping for either).
If you want to display or edit docx etc within your android application, you have to embed some third party code that adds this functionality. I'm not aware of any pre-packaged open source code that can do this, so unless you want to build/port a solution yourself you will need to commercially license something.
As others have noted, there are some open source projects in this area, but they're not packaged/ported to Android. If you did manage to get them ported and integrated, they'd add a huge overhead to your Android app download (eg. 80+ megabytes) and you'd need to then add a mobile suitable UI for them (see https://play.google.com/store/apps/details?id=com.andropenoffice&hl=en_GB for an example of a port with ui that I personally think is not suitable/user friendly for an Android application.)
One such SDK that I'm familiar with which solves this problem is based on the SmartOffice application:
https://artifex.com/products-smart-office-overview/
It's available as an secure embeddable library that supports both display and (optionally) editing of Office documents. You can contact sosales#artifex.com for licensing information.
Disclosure: One of my jobs involves working on the SmartOffice code.
Most of the Microsoft Document viewers are heavy and expensive.
If you want to create a viewer yourself, you should take a look at Apache POI.
A suitable solution might be using Jword in the link below. It's not free but easy to use.
http://www.independentsoft.de/jword/index.html
Using the library is as simple as this sample code
private String docxRead(String filePath) {
try {
WordDocument doc = new WordDocument(filePath);
String text = doc.toText();
return text;
}
catch (Exception e) {
Toast.makeText(context, e.getMessage(), Toast.LENGTH_SHORT).show();
e.printStackTrace();
}
return "";
}
You can use this example for read MS word document file in android application.
I give a link below, you follow this for example.
<https://github.com/AsposeShowcase/Document_Viewer_and_Converter_for_Android>
And follow below link for Aspose Word library for android.
<http://www.aspose.com/android/word-component.aspx>
**You Mostly use for this to Read Ms word document.**
I hope, you will using these Library and make you application better.
Best of Luck.
[1]: http://www.aspose.com/android/word-component.aspx
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.