I recently found out that the out of the box scanner plugin will not scan more than 10 characters for a high density barcode (ex: CODE 39)
Since I use phonegap build, instead of reinventing the wheel, I would like to simply invoke an external barcode scanning app that can return the scanned value back to my app and I can continue from there.
How would I do that on PhoneGap?
I am looking for either a working sample/app or a code that I can use as reference to atleast do a POC.
I ended up forking the barcodescanner repository on github and modifying the phonegap scanner plugin to only show a strip vs a box. This did resolve the issue.
Not the ideal solution, but was easier than architecting my own plugin
Related
There is an npm package for Zebra scanners (Barcode scanner with laser/not camera) that we need to use in an Android app we plan to build with React Native. Now Expo CLI seems like the way to go but after some quick research, we are not too sure if this is possible - to include this zebra package in an Expo project. Can you confirm this is the case?
I ask because of the following facts regarding using Expo:
You can't add native modules (probably a gamechanger for some)
You can't use libraries that use native code in Objective-C/Java
The application should allow a user to use the Zebra scanner running Android OS to scan a barcode and return the scanned data.
Package link: https://www.npmjs.com/package/react-native-zebra-scanner
For anyone still trying to use a laser scanner with Expo, I have found a workaround on my particular device.
In the apps on the device, there is a 'Scanner' app which consists of the settings for the scanning.
There is an 'Output Mode' setting which has a few options. The default option for me was set to 'Broadcast Mode' which doesn't work in an expo app. However, changing to the 'Keyboard Mode' worked.
The difference that I have noticed is that the 'Keyboard Mode' simply reads the bar code and inputs text, it doesn't go to a new line after the scan. To fix this, there is another setting called 'Append suffix' which can be set to the enter key of the device. So whenever a scan is complete, it will automatically go to the next line.
Now when you are implementing your app in Expo, you can create a 'TextInput' and call your function in the 'onSubmitEditting' of that TextInput.
(Optional) I have set the 'autoFocus' of the TextInput to 'True' in order to be able to scan as soon as the page is displayed, as well as the 'blurOnSubmit' to False to stay focused on the TextInput after the scan has been completed and function has been called. This allows for multiple scans without having to click on the TextInput everytime.
Let me know if it works for you :)
#yeslamFaded - as per answer:
In this package you need to change something inside the android/settings file and you dont have this when you work with expo. To use this package you would have to exject from expo
I am trying to make TensorFlow work in my Android device.
I had followed this guide from TensorFlow on how to download and run the sample apps. TF Classify works well, but as I tried TF Detect, I hit an error. I then solved this by forcing CameraActivity.useCamera2API = true as per this GitHub Thread.
After running again, TF Detect and the other samples are now working too.
However when I open the TF Detect, a small toast appears:
Object tracking support not found. see tensorflow/examples/android/README.md
What happens when I use the TF Detect App is that it can detect the objects, but as soon as it shifts to a new one, the previous detection it made would be lost, even if there was minimal to no movement at all. The tracking feature would be greatly helpful with the workflow we plan to build on top of this existing example.
I have checked the readme at the android examples from Tensorflow, but I don't think I've found anything that could help with my issue.
if you look at the readme.md file it says that you need to use cmake as the build system not java, to make the acquisition process fast enough to permit object tracking.
Mike
I have been developing an android app to scan the barcode and QR code and send the results to some other application (HTTP). I have read most of the documentation over internet and here in stack over flow and got it working. I could able to run the stand alone zxing android app on my device, also I could run my own separate android app to use Zxing intent to scan the bar code.
But even after reading so many questions here and some of the blogs in internet, I could not get my strict requirements.
I want to achieve following things.
1. I do not want to install a separate barcode scanner app in my device to get my own app to work (to scan the barcode).
2. I used following code
Intent intent = new Intent("com.google.zxing.client.android.SCAN");
startActivityForResult(intent, 0);
and when I run the app in my devide, it asks 'Select the application to complete this action' and it shows 'Google' and 'Google Goggles' and it opens the Google page default camera and scans the barcode. I wanted CaptureActivtiy default capturing page to come (not Google's one) to scan the bar code.
3. I have tried using ZXing in my own app as library but it did not work.
Could you please tell where exactly I am going wrong to get this done ?
I found "zxing" complicated to use. Then I tried with "ZBar Android Version Library". It was so simple.
You can download the library from here: http://sourceforge.net/p/zbar/news/2012/03/zbar-android-sdk-version-01-released/
Within the downloaded package, there is a very simple example. Just follow it or include the example to your app. Hopefully your task will be done.
You are showing that you want to integrate by Intent. That's the recommended way to do it, and you can make it even easier, and restrict the list of apps that reply with IntentIntegrator. It's about 5 lines of code: https://code.google.com/p/zxing/wiki/ScanningViaIntent
However this contradicts what you're saying about wanting to implement the scanning in your app. You should clarify what you want.
If that's the case, you need to build your own scanning app, and reuse core.jar and perhaps bits of Barcode Scanner in android/. This is not supported -- you're on your own. Please don't clone our app.
I am trying to implement a custom barcode scanner. If I have Zxing installed the app works fine but If I do not the application will error out and you have to force close. I have added IntentIntegrator.java and IntentResult.java into the SRC folder of my project and changed the package name to point to my package, although Im not sure if that is what I am supposed to do. It still will not work. Am I setting this up correctly? I have found many pages that tell me to use the files but not how to set them up to work.
I would like it to smoothly direct the user to download the zxing app from the market if it is not installed on the client phone.
It's because you are not handling ActivityNotFoundException, or checking first to see if the app is installed. That is up to you. But, if you used the provided integration code, it would do this all for you. See http://code.google.com/p/zxing/wiki/ScanningViaIntent
It's not going to launched your app though, no.
i am working on an application that needs to scan bar codes as a functionality..I have integrated all the code of zxing with my app code and now when i try to install it on my device(OS 1.6) it gives me an "INSTALL_FAILED_CPU_ABI_INCOMPATIBLE" error...
i cant use intents to use the barcode application because that will create a necessity to have zxing installed on the device..i want my application to be standalone..
Please suggest what do i do???
I did the same thing you tried to do. I did not have any such error.
Yet, the error mentions ABI, which makes me believe the problem is NDK related. (AFAIK) ZXing doesn't use native code, so you should look at the native code in you application.