zxing

While using the IntentIntegrator from the ZXing library, can I add a flash button to the barcode scanner via the Intent?

泄露秘密 提交于 2021-01-28 23:27:35
问题 I am scanning barcodes and QR codes from an Android app via Intent using the ZXing Library and its port of the Android Application. I added the following two lines in my Gradle dependencies to use the android-integration code without modification: compile 'com.journeyapps:zxing-android-embedded:3.2.0@aar' compile 'com.google.zxing:core:3.2.1' And I am using IntentIntegrator in my Activity to scan a barcode in the onCreate() like this: integrator = new IntentIntegrator(this); integrator

While using the IntentIntegrator from the ZXing library, can I add a flash button to the barcode scanner via the Intent?

允我心安 提交于 2021-01-28 23:05:33
问题 I am scanning barcodes and QR codes from an Android app via Intent using the ZXing Library and its port of the Android Application. I added the following two lines in my Gradle dependencies to use the android-integration code without modification: compile 'com.journeyapps:zxing-android-embedded:3.2.0@aar' compile 'com.google.zxing:core:3.2.1' And I am using IntentIntegrator in my Activity to scan a barcode in the onCreate() like this: integrator = new IntentIntegrator(this); integrator

How to stop BarcodeDetector

℡╲_俬逩灬. 提交于 2021-01-27 23:19:30
问题 How do I stop the barcode Scanner after scan? barcodeDetector barcodeDetector = new BarcodeDetector.Builder(this) .setBarcodeFormats(Barcode.QR_CODE) .build(); } 回答1: You need to release BarcodeDetector after scanning complete. As barcodeDetector.release(); 来源: https://stackoverflow.com/questions/50140928/how-to-stop-barcodedetector

二维码生成器

坚强是说给别人听的谎言 提交于 2021-01-22 19:35:22
本次文章讲解如何通过java代码生成二维码,主要包括两个方面:1、将指定URL转成二维码 2、生成二维码中添加背景图片 生成二维码的功能主要是依赖Google的Zxing包。 1、添加google依赖包Zxing <dependency> <groupId>com.google.zxing</groupId> <artifactId>core</artifactId> <version>3.3.0</version> </dependency> 2、将指定URl转成二维码图片,并设置二维码高、宽度 /** * 生成二维码图片 * * @param url * @param path * @param fileName * @return */ public static String createQrCode(String url, String path, String fileName) { try { Map<EncodeHintType, String> hints = new HashMap<>(16); hints.put(EncodeHintType.CHARACTER_SET, "UTF-8"); BitMatrix bitMatrix = new MultiFormatWriter().encode(url, BarcodeFormat.QR_CODE, 400,

批量生成二维码并压缩zip

我是研究僧i 提交于 2021-01-19 14:15:38
<!-- 二维码生成依赖 --> <dependency> <groupId>com.google.zxing</groupId> <artifactId>core</artifactId> <version>3.4.0</version> </dependency> <dependency> <groupId>com.google.zxing</groupId> <artifactId>javase</artifactId> <version>3.4.0</version> </dependency> @GetMapping("/download") public void download(HttpServletResponse response, Long qrCodeId) throws IOException { byte[] data = uwpQrCodeService.download(qrCodeId); genCode(response,data); } /** * 生成zip文件 */ private void genCode(HttpServletResponse response, byte[] data) throws IOException { response.reset(); response.addHeader("Access-Control

ZXing only recognizes QR-Code

落花浮王杯 提交于 2021-01-06 14:21:52
问题 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

ZXing only recognizes QR-Code

匆匆过客 提交于 2021-01-06 14:18:26
问题 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

Android动态生成二维码

让人想犯罪 __ 提交于 2020-12-28 11:38:14
什么是二维码 二维码又称二维条码,常见的二维码为QR Code,QR全称Quick Response,是一个近几年来移动设备上超流行的一种编码方式,它比传统的Bar Code条形码能存更多的信息,也能表示更多的数据类型。 动态生成二维码方案 在查找二维码生成方案时,发现很多方案的源头都指向了GitHub的开源库 https://github.com/zxing/zxing 。 1. ZXing简介: ZXing全称zebra crossing,翻译过来就是『斑马线』的意思。ZXing是一个采用Java实现的、开源的、支持多格式(一维/二维)的条形码图像处理库。 其中,QRCode格式就是我们常说的二维码格式。 注:QRCode(Quick Response Code:快速响应码)是二维条形码中最常用的一种格式,所以很多人直接将QRCode翻译为二维码,而且连百度百科都这样称呼,笔者也暂时就这么称呼了。 2. ZXing库引入 对于开发者来讲,我们需要下载ZXing库的一个jar包(core-x.x.x.jar)或者通过添加依赖的方式引入库文件,具体方法如下: 方法一: ZXing提供了Maven库,让我们可以根据自己的需要选择想要的jar包版本进行下载。Maven库: https://repo1.maven.org/maven2/com/google/zxing/core/ 方法二

Store Binary Data in QR Code (ZXING Java Library)

别说谁变了你拦得住时间么 提交于 2020-12-13 07:41:34
问题 My Java program needs to send a binary payload via QR Code, but I can't get it to work. I have tried several QR Code libraries and many approaches, but all seem to have this problem. My current implementation uses ZXING. The problem is that all the Java libraries I've tried seem to be focused on String payloads, and do not provide support for binary data. The common suggested solution to this is to encode the binary data as Base64. However, my data is already near the size limit of QR Codes.

SpringBoot使用Hutool生成二维码

谁都会走 提交于 2020-12-11 11:51:49
Hutool是一个小而全的Java工具类库,通过静态方法封装,降低相关API的学习成本,提高工作效率,使Java拥有函数式语言般的优雅,让Java语言也可以“甜甜的”。 官方地址: https://hutool.cn/docs/#/ 邮件文档地址: https://hutool.cn/docs/#/extra/%E4%BA%8C%E7%BB%B4%E7%A0%81%E5%B7%A5%E5%85%B7-QrCodeUtil 一、添加依赖 <dependency> <groupId>cn.hutool</groupId> <artifactId>hutool-all</artifactId> <version>5.3.4</version> </dependency> <dependency> <groupId>com.google.zxing</groupId> <artifactId>core</artifactId> <version>3.3.3</version> </dependency> 二、生成二维码 (1)生成简单的二维码 import cn.hutool.core.io.FileUtil; import cn.hutool.extra.qrcode.QrCodeUtil; import org.springframework.web.bind.annotation