zxing

android中使用zxing扫描二维码以及条形码

匿名 (未验证) 提交于 2019-12-03 00:32:02
步骤一: gradle Zxing 加入以下代码 compile 'com.journeyapps:zxing-android-embedded:3.0.2@aar' compile 'com.google.zxing:core:3.2.0' 步骤二: 生成控件调用 <Button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignEnd="@+id/button" android:layout_alignRight="@+id/button" android:layout_below="@+id/button" android:layout_marginBottom="8dp" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" android:layout_marginTop="8dp" android:onClick="onScanBarcode" android:text="条形码" app:layout_constraintBottom_toBottomOf="parent" app:layout

Unable to execute dex: Multiple dex files define Lcom/google/zxing/BarcodeFormat;编译问题

匿名 (未验证) 提交于 2019-12-03 00:26:01
最近import项目时出现Unable to execute dex,这个问题,困扰很久,网上也有很多答案,但都不细致,不废话,先说解决方案。 先声明: Multiple dex files define Lcom / google / zxing / BarcodeFormat ,这段是说你的 zxing 库出现问题,一般 Unable to execute dex 是由于重复包导入造成的, zxing 库这个概念我并不清楚,这里感谢下一个非常腻害的程序员,微博名@李正阳,他给我指导这个 zxing 库。 在你的 libs 文件夹下,一定有一个重复的包,不是重名,(我刚开始以为重复的包就是重名)我这里是两个 core 包,一个是 core . jar ,一个是 core . 3.1 . 0.jar ,这两个都是 zxing 库的,删除其中一个,再 clean ,不行的话删除另一个。 很早的时候我以为是 buildpath 里面的引入重复了。我把 order and export 里的 Android private libary 和 Android Dpendencies 这两个包去掉,居然编译成功了,但是运行是闪退的,这是个非常大的误区,虽然我并不知道为什么会出现这样的情况,希望大神看到我的文章,能给我解答下。 另外,出现 Unable to execute dex

Winform中使用zxing实现二维码生成(附dll下载)

匿名 (未验证) 提交于 2019-12-02 22:09:29
场景 zxing.dll下载 https://download.csdn.net/download/badao_liumang_qizhi/11623214 效果 实现 新建Winform程序,将上面下载的zxing.dll添加到引用。 拖拽一个按钮,双击进入其点击事件。 private void button5_Click ( object sender , EventArgs e ) { //二维码要存储的内容 string codeString = "测试" ; //生成二维码并返回Bitmap Bitmap bitmap = ZxingHelper . CreateQRCode ( codeString ); //保存图片到本地 //bitmap.Save(@"C:\Users\Administrator\Desktop\a.png"); //将Bitmap转换成Image对象 Image img = Image . FromHbitmap ( bitmap . GetHbitmap ()); //设置pictureBox的图片源 this . pictureBox1 . Image = img ; } 然后在页面上拖拽一个pictureBox用来显示照片 这里新建了一个工具类ZxingHelper,调用其CreateQRCode方法返回生成二维码的Bitmap格式。

Android Generate QR code and Barcode using Zxing

Deadly 提交于 2019-12-02 20:57:15
Code to generate Qr code using zxing is --- It takes string data and the imageview This works just fine private void generateQRCode_general(String data, ImageView img)throws WriterException { com.google.zxing.Writer writer = new QRCodeWriter(); String finaldata = Uri.encode(data, "utf-8"); BitMatrix bm = writer.encode(finaldata, BarcodeFormat.QR_CODE,150, 150); Bitmap ImageBitmap = Bitmap.createBitmap(150, 150,Config.ARGB_8888); for (int i = 0; i < 150; i++) {//width for (int j = 0; j < 150; j++) {//height ImageBitmap.setPixel(i, j, bm.get(i, j) ? Color.BLACK: Color.WHITE); } } if (ImageBitmap

Type mismatch: cannot convert from ByteMatrix to BitMatrix

感情迁移 提交于 2019-12-02 19:47:53
问题 I am creating a QR code generator program in JAVA using ZXING library. The program is import com.google.zxing.BarcodeFormat; import com.google.zxing.WriterException; import com.google.zxing.client.j2se.MatrixToImageWriter; import com.google.zxing.common.BitMatrix; import com.google.zxing.qrcode.QRCodeWriter; import java.io.IOException; import java.nio.file.FileSystems; import java.nio.file.Path; public class QR_Gen { private static final String QR_CODE_IMAGE_PATH = "./MyCode.png"; private

How to scan images using camera in Black berry?

邮差的信 提交于 2019-12-02 17:19:34
问题 I have started one project in which I want to implement QR code scanning functionality. Say for example: ZXing in android. I want to implement for blackberry OS 6 and above. I want to scan live images using camera. Is it possible? If yes, then how it possible? 回答1: You have to use the Barcode API. It was released for OS 6.0. Before that, there was ZXing (added in 5.0) but no livescan functionality. Here you are the how-to: http://supportforums.blackberry.com/t5/Java-Development/How-to-use-the

Android ZXing implementation

元气小坏坏 提交于 2019-12-02 14:22:45
问题 I created a project with the ZXing source code. That works fine. After I changed the package name com.google.zxing.client.android to com.google.zxing.client.android.vofox But it shows error in real device (HTC Wildfire) It has no error in eclipse emulator. My logcat file shown below. 08-23 17:13:58.899: ERROR/AndroidRuntime(9816): FATAL EXCEPTION: main 08-23 17:13:58.899: ERROR/AndroidRuntime(9816): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.google.zxing.client

Why there is another application called Leaks installed on the Android device when I use ZXing Bar code Library ?

自闭症网瘾萝莉.ら 提交于 2019-12-02 11:45:05
I have an application that uses ZXing Barcode Scanner library, but when I run the application on the device, there is another additional application installed called "Leaks". Why is this application installed on the device ? When I open it nothing happens ? It's an application called leak canary. // For development purposes only // https://github.com/square/leakcanary debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1' releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1' Remove these lines from build.gradle file if you have them. You should also have this line

Android ZXing implementation

此生再无相见时 提交于 2019-12-02 09:20:46
I created a project with the ZXing source code. That works fine. After I changed the package name com.google.zxing.client.android to com.google.zxing.client.android.vofox But it shows error in real device (HTC Wildfire) It has no error in eclipse emulator. My logcat file shown below. 08-23 17:13:58.899: ERROR/AndroidRuntime(9816): FATAL EXCEPTION: main 08-23 17:13:58.899: ERROR/AndroidRuntime(9816): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.google.zxing.client.android.vofox/com.google.zxing.client.android.vofox.CaptureActivity}: android.view.InflateException:

ZXing vs ZBar: 开源条形码SDK性能PK

孤人 提交于 2019-12-02 03:32:05
很多手机app条形码应用都使用了ZXing和ZBar两个开源条形码SDK。那么从检测速度和检测率看哪个更出色呢?ZXing用Java实现,ZBar用C/C++实现,为了确保公平,这里用JNI封装ZBar,用Java写测试。 参考原文: How to Benchmark Barcode SDK Performance – ZXing vs ZBar 作者: Desmond Shaw 翻译:yushulx SDK下载 ZXing Source code https://github.com/zxing/zxing ZBar Source Code https://github.com/ZBar/ZBar ZBar Windows Installer http://sourceforge.net/projects/zbar/files/zbar/ 如何使用Java解码TIFF文件 通过Java SDK中的ImageIO,我们可以解码很多图片格式,比如JPEG,PNG,BMP。但是TIFF是不支持的。实际使用的时候,经常会用到TIFF文件读取条形码。Oracle官方提供了 Java Advanced Imaging (JAI) 来支持TIFF。 JAI下载 照理说Oracle的官网是应该提供JAI的下载链接的。但是很奇怪的是打开之后都是404错误。在网上搜了一圈,找到了一个可用链接: