Programmatically invoke in Android 9 the QR code scanner system app - android

Starting from Android 9 (API level 28) a new system app is available for scanning barcodes 1D/2D : its name is "QT code scanner".
Is there any intent to call this system app and have it handle barcode detection in live camera preview to just grab the decoded string in onActivityResult() when the app is done?
Thanks!

Related

Zebra Datawedge 6.2.24 enable/disable not working on Zebra TC75

I am trying to get zebra data wedge to enable /disable sample ( https://github.com/darryncampbell/DataWedge-Quick-Suspend-Scanner ) working on zebra TC 75 scanner handset having android version 5.1.1
data wedge version on Zebra TC75 handset is 6.2.24 ( original data wedge version 5.0.17 upgraded to version 6.2.24 by using check system updates). create profile API does not work, so I manually created a profile named "DW Quick Suspend Profile" and enabled this profile. the app is added to associated apps, the barcode input option is checked intent output option is checked. Intent action is specified as com. Darren Campbell.datawedgequicksuspendscanner.action and intent category is specified as android.intent.category.DEFAULT. Broadcast intent is selected for the intended delivery spinner.
but zebra TC75 does send status updates or enable/disable data wedge does not work.
whether anyone got data wedge to enable/disable API or sample code at https://github.com/darryncampbell/DataWedge-Quick-Suspend-Scanner working on Zebra TC 75? if yes what configuration needs to be changed
App author here, the reason SUSPEND_PLUGIN and RESUME_PLUGIN are not working for you is that they are not supported in DataWedge 6.2. DW 6.2 documentation is here: https://techdocs.zebra.com/datawedge/6-2/guide/api/#scannerinputplugin and only shows ENABLE_PLUGIN and DISABLE_PLUGIN as supported.

Access USB camera Xamarin.Android

I'm developing a Xamarin.Android project and I need to get the video flow from the usb camera attached to the android device for the test. Now, I'm using Camera2 API from the Android Open Source project to access each camera frame, but the API with the call to:
CameraManager manager =
(CameraManager)Android.App.Application.Context.GetSystemService(Context.CameraService);
foreach (string cameraId in manager.GetCameraIdList()){
Console.WriteLine(cameraId);
}
doesn't return the USB camera attached to the device. I've tryed this[1] app to serach the USB camera and the device found it correctly.
Is that I fall to search for available device with the call to CameraManger.GetCameraIdList()?
Thanks.
[1]: https://play.google.com/store/apps/details?id=com.shenyaocn.android.usbcamera

RhoMobile on TC52, Android 8.1: "DS8178 Bluetooth Scanner is not connected ..."

I am trying to get an existing RhoMobile APK running on a TC52, Android 8.1.
The App is running fine on TC51, Android 6. On the TC52, when i start the app I get a toast message
DS8178 Bluetooth Scanner is not connected, therefor BTPairing Utility will be started.
The problem is that - ignoring the BTPairing Utility App (i also tried to disable it) - i cant use the build in scanner in my rho mobile app. When I try to use it I see the following message in the log
"The decodeSound barcode property can only be set once the scanner has finished initialising"
Looking at the underlying code, it looks like that the scanner has not initialised, probably due to not be able to pair the bluetooth scanner. But there is now such scanner and there never will be. Anybody know how to disable this behaviour?
Edit 1:
Here is my javascript code for enabling the scanner
Rho.Barcode.enable({ allDecoders: true }, this.onScan);
But, I think it happens before that javascript is accessed; the app is hosted on web server; even if i disable WIFI and starting the app, the toast is displayed. It seems like that RhoMobile is trying to setup all known scanners.
Edit 2:
When I enumerate all scanners, i get those in this order
Scanners found: '[
"Camera Scanner",
"2D Barcode Imager",
"Bluetooth Scanner",
"RS6000 Bluetooth Scanner",
"DS3678 Bluetooth Scanner",
"LI3678 Bluetooth Scanner",
"DS2278 Bluetooth Scanner",
"DS8178 Bluetooth Scanner"]'
Default scanner: '2D Barcode Imager'
Default scanner is determined by
Rho.Barcode.getProperty("friendlyName");
Edit 3:
Ok, as suggested in the comments, using the actual instance returned from the enumeration works; triggering scanner buttons works well.
What remains is the toast that asks to connect the DS8178 Bluetooth Scanner; is there a way to disable scanners from config.xml?
This error:
DS8178 Bluetooth Scanner is not connected, therefor BTPairing Utility will be started.
Is not coming from RhoMobile, it is being generated from the low level scanning framework. I checked on a more up to date device and I'm glad to say they fixed the spelling error. It is caused when something (either EMDK or DataWedge) tries to enable the DS8178 scanner. The DS scanner support was only added in a recent version of the mobile computing scanner framework so that probably explains the difference in behaviour you are seeing between TC51 and TC52.
RhoMobile (on Zebra Android devices) wraps the EMDK and exposes each supported scanner as a separate Barcode object and you can see all of these in the array returned from enumerate. What is strange is that, per your second edit, the default scanner is '2D Barcode Imager'.
There are a few options / possibilities:
There is a bug in the RhoMobile framework and for some reason the DS8178 scanner is being enabled. I checked https://github.com/rhomobile/rhodes/tree/master/lib/commonAPI/barcode/ext/platform/android/src/com/rho/barcode and cannot see any such bug. Rho is open source but supported by Tau-Technologies if you wanted to explore that route.
Something else on your device is enabling the DS8178 scanner, e.g. a DataWedge profile or other app using the EMDK. You could disable DataWedge (from the DataWedge app settings) and reboot your device to test this.
There is an issue with the TC52. I would say this is the least likely as I have never heard of a similar issue
There is no way to disable any of the scanners via XML

Mobile Vison API detect no QR code

I'm developing a QR code scanner with Mobile Vision API (play-services-vision 11.0.1). I've run my application on two Android devices (Xperia SO-04E Android 4.2.2). My application works correctly on one device but does not detect QR code on the other. Camera started correctly, but detected no QR code. Does anyone know a solution? Might does a device's configuration cause this?
A part of source code(Activity written in Kotlin) is as below. I've configured the camera permission in AndroidManifest.xml.
// instantiate barcode detector in an Activity onCreate method
val barcodeDetector = BarcodeDetector.Builder(this).build()
cameraSource = CameraSource.Builder(this, barcodeDetector)
.setAutoFocusEnabled(true)
.setRequestedPreviewSize(1600, 1024)
// set callback
barcodeDetector.setProcessor(object: Detector.Processor<Barcode>?) {
override fun release() {}
override fun receiveDetections(detections: Detector.Detections<Barcode>?) {
・・・
// parse a detected QR code
・・・
}
}
Check internet connection on the second device; As Vision API requires Google play services and this needs internet connection; however need not to provide permission in Manifest file..

How to scan the barcode of format PDF 417 using zxing app in android?

How do i scan the barcode of format PDF417 ? Do i need to pass intent extras?
(Note : Zxing barcode app is already installed in my device). Please help me.
Here is my code for using Zxing barcode scanner from my application using Intent
Intent intent = new Intent("com.google.zxing.client.android.SCAN");
intent.setPackage("com.google.zxing.client.android");
intent.putExtra("SCAN_MODE", "PRODUCT_MODE");
startActivityForResult(intent, MY_ACTIVITY_CONSTANT);
"PRODUCT_MODE" will never work as PDF417 is not a product barcode format. You need to set "SCAN_FORMATS" to "PDF_417" instead. However you probably will find it difficult to scan PDF417 in general. Barcode Scanner+ will read it better and responds to these intents.
with the mit app inventor 2, with a barcodescanner object you can do it.
Install in the device the ZXing barcode reader, then goto config and enable pdf417 format (it comes disabled by default) and then download or program any barcode reading app with external barcode reader. Works fine.

Categories

Resources