简体   繁体   中英

Issue with Zbar qr code scanner on Sony Phone

I am developing an android application that scans QR codes using the Zbar API. However upon testing, I have noticed that the application worked perfectly fine on Samsung, HTC and a chinese brand phone but not on a sony device(Xperia z1). What happens is that the camera and viewer works fine in the first few seconds but suddenly crashes. Is there an issue with regards to the Zbar API for it not to work with Sony phones, or is this an isolated scenario?? Are there already solutions for this kind of problem?? I do not know if this is the correct place to post it. I cannot try getting the error from logcat since the device is used by a customer, and I do not have a sony device available for me to test it.

Try these settings on the ImageScanner,

scanner = new ImageScanner();
//Slows the frame, but does the job
scanner.setConfig(0, Config.X_DENSITY, 1);
scanner.setConfig(0, Config.Y_DENSITY, 1);
scanner.setConfig(0, Config.ENABLE, 0);
// Only enable the codes your app requires
scanner.setConfig(Symbol.QRCODE, Config.ENABLE, 1);

Made a huge difference in my app.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM