ZXing only recognizes QR-Code - zxing

I am trying to develop a barcode scanner for google glass (don't judge) using the ZXing library.
Scanning QR-Codes works perfectly fine, but I can't scan any 1D-barcodes.
This is my code:
Intent intent = new Intent(this, CaptureActivity.class);
//intent.putExtra("SCAN_MODE", "PRODUCT_MODE"); //doesn't work with or without this line
startActivityForResult(intent, SCAN_REQUEST);
Here is an example (EAN-8):
Scanning this with a scanner from the PlayStore works on my phone, but not using my app on the glass.

I found a workaround for my problem in the DecodeRunnable.java.By adding BarcodeFormat.EAN_8 to the list in the code below I was able to scan the barcode.
DecodeHandler() {
hints = new EnumMap<>(DecodeHintType.class);
hints.put(DecodeHintType.POSSIBLE_FORMATS,
Arrays.asList(BarcodeFormat.AZTEC, BarcodeFormat.QR_CODE, BarcodeFormat.DATA_MATRIX));
}
You are wellcome to post your answers, because I believe there is a better way to solve this.

Related

How to customize the Flutter barcode scanner

I'm using the Flutter barcode scanner. What I'm able to achieve is like
But what I need is like this.
Same question was asked here. How to make a customised QR Code Scanner using Flutter?. But I want to customize using the same Flutter barcode scanner package. Can anyone help me with this.
My code is
String barcodeScanRes = await FlutterBarcodeScanner.scanBarcode(
'#00FFB6',
'Exit',
true,
ScanMode.QR,
);
You can use qr_code_scanner 1.0.1 which give you ability to customize your scanner as shown below

iOS 16 barcode not scanning properly

I've a QR code & barcode scanning native iOS app which was working properly before iOS 16. After iOS 16 release, the bar code scanning happens only when positioning the bar code at the bottom part of the rectOfInterest.
Right now I've defined the metadatObjectTypes as below:
captureMetadataOutput.metadataObjectTypes = [.qr, .ean13, .ean8, .aztec, .upce, .code39, .code39Mod43, .code93, .upce, .interleaved2of5, .itf14, .code128, .pdf417]
But the bar code scanner is working properly (it scans everywhere inside the rectOfInterest) if we set scanner's metadataObject type omitting QR code type (.qr) as below but it results in not scanning the QR code.
Have referred the below two links where they are trying to scan either of the bar codes but not both types:
https://developer.apple.com/forums/thread/714341
https://developer.apple.com/forums/thread/715055
As I couldn't find the solution for this issue, someone kindly suggest the possible fix for scanning both QR and barcode types.

Leaflet 1.7.1 popup on mobile Bug

I am working on a new Leaflet map with 1.7.1.
I noticed on my mobile device browsers (on Safari and Chrome) that the popups are flickering (not displaying/not showing up). I went on the Leaflet website with my mobile trying one of their example e.g. on their very home-page and I am facing the same problem. Is this my mobile or this problem is already known?
After more research ... I found out that this is an actual bug.
By commenting the following lines of code in the JS file will resolve the problem.
// simulate click if the touch didn't move too much
// if (this._isTapValid()) {
// this._simulateEvent('click', first);
// }

Unity WebGL Mobile browser workaround and keyboard input fix?

Hey everyone so I read that unity doesn't really support mobile browsers for WebGL games. im using 2020.1.4.And sure enough, the game gets a bit distorted by not being scaled properly. it's like the camera is bigger so it shows on the screen that blue color. I tried some things, setting width and height to auto or removing config.devicePixelRatio = 1; as suggested by a friend but nope! still looks horrible! And if that wasn't enough the keyboard doesn't show up when clicking on form fields. i tried this one
https://github.com/eforerog/keyboardMobileWebGLUnity
which displayed an error when pressed on and this one
https://github.com/dantasulisses/WebMobileInputFix which just didn't even compile!
Any ideas, please?
I did my research and tried every plugin I could find. I used Unity 2020.3.28f1 and tested both on Android-phone and iPhone.Here is my report.
These plugins don't work:
https://unitylist.com/p/f58/Unity-webgl-inputfield
https://github.com/eforerog/keyboardMobileWebGLUnity
https://github.com/dantasulisses/WebMobileInputFix
This plugin works, but you should use different settings for IOS and Android on same input field game object. If you use "prompt", it works for IOS only, and "overlay" works for Android only. Look for documentation in page:
https://github.com/unity3d-jp/WebGLNativeInputField
And this plugin works best at the moment. Yes, it is a bit ugly though, but it works.
https://github.com/kou-yeung/WebGLInput
And there is a fix for Unity 2021 for it:
https://github.com/kou-yeung/WebGLInput/releases/tag/1.0
There's a keyboard that overlays, when using it you just need to tap the notification to access it and then click the "back" button to hide it https://play.google.com/store/apps/details?id=com.fishstix.gameboard
I made this project that simply recreates a keyboard using buttons in unity.
I implemented it in a WebGL build successfully.
https://github.com/thetimeste/WebGL-Build-Keyboard-Unity.git
I would recommend using the native js window.prompt() fields as of writing. They have great cross-platform support, allow for extra features like special characters, emojis, copy and paste etc. and are pretty easy to set up. Once (or honestly if ever) Unity adds their own reliable implementation you can easily remove this lightweight implementation.
Create a .jslib file that has a function opening a window.prompt(description, currentText)
Return the result at the end of that function back to a unity object with a recipient script
Make a derivation from Unity's event system overwriting the OnApplicationFocus(bool focus) function (leaving it empty), to fix a sneaky Chrome Android bug.
That's it. The result should look something like in this demo: https://pop.demo.neoludic.games
If you want to save some development time on a feature that really should just be native in Unity, you can also check out my plugin based on the method above. https://neoludic-games.itch.io/pop-input
I also need to enable mobile virtual keyboard for running webgl on mobile device.
I've tried the code from your mentioned url. It gives you some idea on how to do
it, but the code are totally buggy and unusable. Now I am trying to implement it
by myself.

Has the iOS9 update caused C# codes not work properly?

I have a piece of code which is not working after the iOS9 update on devices, specifically Safari browser (Both iphone and ipad). It works fine in Chrome on the device using iOS9 but Safari is having sme kind of issue which I'm unable to debug. There was no issues in both the browsers on the device till iOS8.
Basically the functionality is a person needs to select 2 images from a set of images and click the GO button. If the images match with the ones saved at backend(DB) then he gets navigated to the next screen, else it shows a Cross symbol and refreshed the page asking the User to select the images again.
Please help and thanks.
Below is the piece of code which I feel is having the issue :
string cbref = Page.ClientScript.GetCallbackEventReference(this,
"arg", "fnGetOutputFromServer", "context");
string cbScr = string.Format("function fnCallServerMethod(arg," +
" context) {{ {0}; }} ", cbref);
Page.ClientScript.RegisterStartupScript(GetType(), "fnCallServerMethod", cbScr, true);
I put an alert within fnGetOutputFromServer but that never showed up in the device Safari browser. Please help me as I feel totally confused as to why it is not working. Also, I'm okay if I have to change the whole line to put a work around to this or by directly calling the function or something.
Note : This works fine in Chrome on an iOS9 device but does not work in Safari and the same works fine while emulating as iphone/ipad on the PC
Thanks again in advance.
http://www.brillianceweb.com/blog/article/69/aspnet-20-misidentifies-safari-71-on-ios-and-os-x
This fixed it !!! :)
I had to get the latest AppleWebkit version for iOS9 and got it updated in the configuration file which resolved the issue