

ZXing Barcode Scanning on Android Skipping Frames Issue
source link: https://www.tuicool.com/articles/ABrUzuF
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

After my live stream on how to implement barcodes with ZXing in Xamarin.Forms I got a lot of wonderful responses, thank you for that! There were a couple that are about a problem that people experience on Android. Here is a quick post on how to counter those.
Scanning Barcodes with ZXing
In myoriginal post and the stream I show you how you can incorporate barcode scanning into your Xamarin.Forms application. The basics are very easy, but the binding libraries to ZXing seem to have some rough edges.
Skipping Frames issue
The “error” people are experiencing has to do with a message saying “Skipped 68 frames! The application may be doing too much work on its main thread” in the output of the application. Typically, this means you might be doing too much work on the main thread and you need to move some heavy duty jobs to the background.
However, in this case the solution is much more simple. I’m not sure if this problem originates in the ZXing library, or the binding library by Redth, but in any case there are two setting that you can configure that will prevent this. Here they are:
You set this in the MobileBarcodeScanningOptions object that you add to your scanner view. There isn’t much documented about this, so I took a little dive in the source. It seems these values are used here to determine if there is enough time between the frames. Some people I talked to had just one of these options, apparently it’s important to have both.
The really weird thing is, that this seems to be in milliseconds, but actually setting the value to be lower than the default setting seems to be working better. I guess you will have to have a little play for yourself to see what works in your case.
While the problem seems to occur on Android mostly, other platforms might be affected by these settings as well.
Something that also might work is to set the IsAnalyzing property to false whenever you have scanned something and are processing. If you have any more pointers regarding this, please reach out !
In Closing
Thank you again everyone for watching (back) the stream. If you’ve missed it, you can rewatch it here . Don’t forget to subscribe!
A special thanks to @SmartmanApps who not only just came with this question, but also figured this out with me.
Recommend
-
126
Project in Maintenance Mode Only The project is in maintenance mode, meaning, changes are driven by contributed patches. Only bug fixes and minor enhancements will be considered. The Barcode Scanner app can no longer be published, so it's...
-
107
The Razer Phone is likely skipping the Android 8.0 Oreo update and moving straight to Android 8.1 Oreo, according to evidence discovered by XDA-Developers.
-
41
Cloud Connectivity Android Barcode / QR Code Scanner using Google Mobile Vision – Building Movie Tickets App ...
-
6
react-native-dbr This is a sample that shows how to implement barcode scanning in React Native using Dynamsoft Barcode Reader SDK.
-
9
README.md React Native Camera
-
5
3 Image Processing Techniques For Building Barcode Scanning Software January 21st 2021 new story
-
9
一扫天下——ZXing使用全解析 二维码现在已经烂App了,不管什么App,没有二维码就好像低人一等了。所以,在自己的项目中集成二维码功能还是非常有必要的。 网上很多都是基于ZXing2.3的,但是现在都3.1了,改了很多bug,也进行了很多优化,最好...
-
225
Using Google’s MLKit and CameraX for Lightweight Barcode ScanningWhat is Google’s MLKit?MLKit is a powerful Machine Learning library optimized for mobile applications. Previously known as ML Kit for Firebase, it i...
-
5
想了解更多内容,请访问:
-
8
Peter Spielvogel August 8, 2022 3 minute read...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK