Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/200.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android Zxing导致应用程序停止&;出口_Android_Barcode_Zxing_Barcode Scanner - Fatal编程技术网

Android Zxing导致应用程序停止&;出口

Android Zxing导致应用程序停止&;出口,android,barcode,zxing,barcode-scanner,Android,Barcode,Zxing,Barcode Scanner,我正在尝试将zxing作为库添加到我的android应用程序中——它必须是离线的,所以在应用程序外部使用Intent是不好的,因为很多人不会有条形码扫描仪。 我有Zxing作为库,名称是“zxingLib”,在我的应用程序中添加了“IntentIntegrator”和“IntentResult”+core.jar 在我的应用程序中,我通过按钮调用zxing: public void scanNow(View view){ IntentIntegrator integrator = ne

我正在尝试将zxing作为库添加到我的android应用程序中——它必须是离线的,所以在应用程序外部使用Intent是不好的,因为很多人不会有条形码扫描仪。 我有Zxing作为库,名称是“zxingLib”,在我的应用程序中添加了“IntentIntegrator”和“IntentResult”+core.jar

在我的应用程序中,我通过按钮调用zxing:

public void scanNow(View view){

    IntentIntegrator integrator = new IntentIntegrator(this);
    integrator.initiateScan();
}
为了获得结果:

public void onActivityResult(int requestCode, int resultCode, Intent intent) {
      IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
      if (scanResult != null) {
          intent.putExtra("com.tajchert.kolejrogowska.SCAN.SCAN_MODE", "QR_CODE_MODE");
          String contents = intent.getStringExtra("SCAN_RESULT");
          String format = intent.getStringExtra("SCAN_RESULT_FORMAT");
          Toast toast = Toast.makeText(this, "Content:" + contents + " Format:" + format , Toast.LENGTH_LONG);
          toast.setGravity(Gravity.TOP, 25, 400);
          toast.show();
      }
    }
按下后显示messege安装条形码阅读器(从谷歌播放)-我做错了什么? 但如果我的手机上已经有条形码,它就会停止(应用程序和条形码阅读器)。 日志类别:

知道那个错误的原因是什么吗?在一个例子中,我看到我的活动应该扩展ActivityCapture而不是activity,但如果我这样做,eclipse会将其标记为错误

我正在尝试将zxing作为库添加到我的android应用程序中

ZXing团队不支持这一点,上次我检查过

它必须是离线的,所以在应用程序外部使用意图是不好的,因为很多人不会有条形码扫描仪

大概,当他们安装你的应用程序时,他们是在线的。因此,当他们安装条形码扫描仪时,他们大概可以在线

在我的应用程序中添加了“IntentIntegrator”和“IntentResult”+core.jar

IntentIntegrator
用于与条形码扫描仪应用程序集成。您说过不想与条形码扫描仪应用程序集成

按下后显示messege安装条形码阅读器(从谷歌播放)-我做错了什么

您正在使用试图与条形码扫描仪应用程序集成的
IntentIntegrator

知道那个错误的原因是什么吗


这似乎是条形码扫描仪应用程序中的一个问题。尝试从启动器运行条形码扫描仪,看看它是否也会崩溃。如果是这样的话,那么条形码扫描器和您的设备之间就有一些不兼容。

那么Android下是否有离线的条形码库?是的,当用户在线时安装该应用程序,但它设计用于在电话信号非常低的地方工作。好吧,我把这个监管者搞砸了。给我5分钟。我将测试条形码独立应用程序。@Primosz:“那么Android下有没有离线的条形码库?”——可能,但我没有去寻找。你是对的。我手机上的条形码扫描仪应用程序有问题。很奇怪,因为我不久前用过它。其他条形码阅读器(不是zxing)工作没有问题。是的,我收到了崩溃日志。这似乎是一个设备错误。它没有发送一个大小与其所发送内容相符的YUV图像。@Primosz和条形码扫描库可以包含在应用程序中
11-15 14:26:50.132: I/Process(29283): Sending signal. PID: 29283 SIG: 9
11-15 14:27:50.194: E/Trace(29345): error opening trace file: No such file or directory (2)
11-15 14:27:50.202: V/ActivityThread(29345): com.google.zxing.client.android white listed for hwui
11-15 14:27:50.389: I/a(29345): Using implementation class com.google.zxing.client.android.common.executor.HoneycombAsyncTaskExecInterface of interface com.google.zxing.client.android.common.executor.AsyncTaskExecInterface for SDK 11
11-15 14:27:50.491: I/a(29345): Using implementation class com.google.zxing.client.android.camera.open.GingerbreadOpenCameraInterface of interface com.google.zxing.client.android.camera.open.OpenCameraInterface for SDK 9
11-15 14:27:50.491: I/GingerbreadOpenCamera(29345): Opening camera #0
11-15 14:27:51.116: I/CameraConfiguration(29345): Screen resolution: Point(854, 480)
11-15 14:27:51.116: I/CameraConfiguration(29345): Supported preview sizes: 1280x720 848x480 640x480 352x288 320x240 176x144 
11-15 14:27:51.116: I/CameraConfiguration(29345): Found best approximate preview size: Point(1280, 720)
11-15 14:27:51.116: I/CameraConfiguration(29345): Camera resolution: Point(1280, 720)
11-15 14:27:51.155: I/CameraConfiguration(29345): Initial camera parameters: rotation-values=0,90,180,270;mot-postview-mode=on;zoom=0;mot-video-size=640x480;mot-sensor-display-orientation-support-values=off,on;mot-face-track-frame-skip=15;zoom-supported=true;mot-flip-mode-values=off;whitebalance=auto;mot-face-track-mode=off;scene-mode=auto;jpeg-quality=85;preview-format-values=yuv420sp,yuv422i-yuyv;rotation=0;mot-picture-iso-values=auto;jpeg-thumbnail-quality=75;preview-format=yuv420sp;mot-zoom-step=0.5;mot-sensor-display-orientation=0;video-size-values=;mot-video-stabilization-values=off;mot-image-stabilization-values=off;preview-size=848x480;focal-length=3.92;mot-max-picture-continuous-zoom=6;flash-mode-values=off,on,auto,torch;preview-frame-rate-values=10,15,20,24,25,30;mot-image-stabilization=off;mot-exposure-offset-values=-3,-2.67,-2.33,-2,-1.67,-1.33,-1,-0.67,-0.33,0,0.33,0.67,1,1.33,1.67,2,2.33,2.67,3;preview-frame-rate=24;mot-face-detect-num-faces=4;mot-max-face-detect-num-faces=9;focus-mode-values=auto,macro,infinity,off;jpeg-thumbnail-width=320;scene-mode-values=auto,portrait,landscape,action,night-portrait,sunset,steadyphoto;preview-fps-range-values=(10000,30000),(10000,25000),(10000,20000),(10000,24000),(10000,15000),(10000,10000);mot-face-track-mode-values=off;jpeg-thumbnail-size-values=0x0,320x240;zoom-ratios=100,200,300,400;mot-zoom-speed=50;preview-size-values=176x144,320x240,352x288,640x480,848x480,1280x720;picture-size-values=320x240,640x480,1280x960,1600x1200,2048x1536,2592x1456,2592x1936;preview-fps-range=10000, 30000;min-exposure-compensation=-9;antibanding=auto;mot-video-size-values=176x144,320x240,352x288,640x480;vertical-view-angle=40;horizontal-view-angle=53;mot-sensor-display-orientation-support=off;jpeg-thumbnail-height=240;cam-mode=0;smooth-zoom-supported=false;mot-picture-iso=auto;mot-continuous-zoom-step-values=1,0.5,0.25;max-video-continuous-zoom=6;focus-mode=on;mot-video-stabilization=off;mot-flip-mode=off;mot-sensor-display-orientation-values=0,90;video-frame-format=yuv422i-yuyv;picture-format-values=jpeg;mot-areas-to-focus=0;max-exposure-compensation=9;mot-postview-modes=off,on;exposure-compensation=0;exposure-compensation-step=0.3333333333333;mot-max-areas-to-focus=1;flash-mode=off;effect-values=none,mono,sepia,negative,solarize,red-tint,green-tint,blue-tint;picture-size=2592x1936;mot-timestamp-mode=off;max-zoom=3;effect=none;mot-timestamp-mode-values=off,on;mot-exposure-offset=0;whitebalance-values=auto;picture-format=jpeg;jpeg-thumbnail-size=320x240;antibanding-values=auto
11-15 14:27:51.155: I/CameraConfiguration(29345): Supported values: [off, on, auto, torch]
11-15 14:27:51.155: I/CameraConfiguration(29345): Settable value: off
11-15 14:27:51.155: I/CameraConfiguration(29345): Supported values: [auto, macro, infinity, off]
11-15 14:27:51.155: I/CameraConfiguration(29345): Settable value: auto
11-15 14:27:51.218: I/a(29345): Using implementation class com.google.zxing.client.android.common.executor.HoneycombAsyncTaskExecInterface of interface com.google.zxing.client.android.common.executor.AsyncTaskExecInterface for SDK 11
11-15 14:27:51.225: I/a(29345): Current focus mode 'on'; use auto focus? false
11-15 14:27:51.225: I/Choreographer(29345): Skipped 52 frames!  The application may be doing too much work on its main thread.
11-15 14:27:51.257: D/e(29345): Calculated framing rect: Rect(127, 60 - 727, 420)
11-15 14:27:51.530: W/dalvikvm(29345): threadid=13: thread exiting with uncaught exception (group=0x40a9f300)
11-15 14:27:51.530: E/AndroidRuntime(29345): FATAL EXCEPTION: Thread-358
11-15 14:27:51.530: E/AndroidRuntime(29345): java.lang.ArrayIndexOutOfBoundsException: src.length=610560 srcPos=610750 dst.length=485460 dstPos=347913 length=899
11-15 14:27:51.530: E/AndroidRuntime(29345):    at java.lang.System.arraycopy(Native Method)
11-15 14:27:51.530: E/AndroidRuntime(29345):    at com.google.zxing.m.a(Unknown Source)
11-15 14:27:51.530: E/AndroidRuntime(29345):    at com.google.zxing.b.j.a(Unknown Source)
11-15 14:27:51.530: E/AndroidRuntime(29345):    at com.google.zxing.c.a(Unknown Source)
11-15 14:27:51.530: E/AndroidRuntime(29345):    at com.google.zxing.g.a.a(Unknown Source)
11-15 14:27:51.530: E/AndroidRuntime(29345):    at com.google.zxing.i.b(Unknown Source)
11-15 14:27:51.530: E/AndroidRuntime(29345):    at com.google.zxing.i.a(Unknown Source)
11-15 14:27:51.530: E/AndroidRuntime(29345):    at com.google.zxing.client.android.h.handleMessage(Unknown Source)
11-15 14:27:51.530: E/AndroidRuntime(29345):    at android.os.Handler.dispatchMessage(Handler.java:99)
11-15 14:27:51.530: E/AndroidRuntime(29345):    at android.os.Looper.loop(Looper.java:137)
11-15 14:27:51.530: E/AndroidRuntime(29345):    at com.google.zxing.client.android.i.run(Unknown Source)