android - zxing barcode scanner giving notfoundexception -


Using the code below, I get a notified passphrase all the time. Please help.

  Bitmap bitmap = BitMapfinderReddodersource (MyActivity.This.JetterSource (), ArndrableBarcode_Dream); Int [intArray = new int [bMap.getWidth () * bMap.getHeight ()]; // Copy copy pixel data from 'bitmap' intere 'array BIMAP.getpixel (intere, 0, bmap, gatewythth), 0, 0, bmapgetwidth (), bmapgatehite ()); LuminanceSource Source = New RGBLuminanceSource (bMap.getWidth), bMap.getHeight (), intArray); Binarybitmap bitmap = new binarybitmap (new hybridbenerizer (source)); Reader Reader = New MultiFormatReader (); // Use it otherwise try Checksam Expansion {hashtable & lt; DecodeHintType, Object & gt; DecodeHints = new hashtable & lt; Decodheinttype, object & gt; (); decodeHints.put (decodheinttype.trY_HARDER, boolean.true); //decodehints.put(DecodeHintType.PURE_BARCODE, boolean. TRUE); Result result = reader.decode (bitmap, decoded); If (result! = Null) {utility. ShortshotShort (MyActivity.This, Results .getText ()); } Other {Utility ShortshotShort (MyActivity.This, "Bar code can not be scanned"); }} Catch (NotFoundException e) {e.printStackTrace (); } Catch (checksum expedition e) {e.printStackTrace (); } Hold (Format Expansion E) {e.printStackTrace (); }}   

I've added zxing-2.1.jar under the Libs / folder. This works when I call IntentIntegrator. image description here enter

Figure Barkod_dimmi in the top bar / folder.

Edit:

I also tried with the image below.

Enter image details here

Thanks in advance.

LOGCAT:

  Fatal Exception: Main E / AndroidRuntime (9580): java.lang.RuntimeException: java.lang.NullPointerException E / AndroidRuntime (9580): Unable to compute {com.webintesive.expertly / com.webintesive.expertly.MyActivity} to start an activity in android.app .ActivityThread.performLaunchActivity (ActivityThread.javaXX313) E / AndroidRuntime (9580): on android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2365) e / AndroidRuntime (9580): on android.app.ActivityThread.access $ 600 (ActivityThread.java:156) e / AndroidRuntime (9580): Android. App ActiveWitTread $ H. Holland Message (ActivityTrad.Java first 344) E / Android timeTime (98080): OD OShandler on Ander. Disappemessage (Handler. Java: 99) E / Android TimeTime (980): Android. Los. Looper Loop (Looper.Java 153) E / Android TimeTime (9 580): Android. App On Activitatrad Main (ActivityThread.java:5336) E / AndroidRuntime (9580): On java.lang.reflect.Method.invokeNative (Native Method) E / AndroidRuntime (9580): On java.lang.reflect.Method.invoke (Method.java : 511) E / Android Time (9580): com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run (ZygoteInit.java:833) E / Android Time (9580): at com.android.internal.os.zygoteInit.main ( Zigoteinit.java: 600) E / Android Retintman (9 580): Dlvic. System. NetStart.Main (Native Methods) `E / Android Time (9 580): Due to: java.lang.NullPointerException`` E / Android Time (9580): com.webintesive.expertly.MyActivity.showPhotoFromImageUri (MyActivity.java:167) `` E / AndroidRuntime (9580): com.webintesive.expertly.MyActivity.init at (MyActivity.java:120) `` E / AndroidRuntime (9580): com.webintesive.expertly.MyActivity.onCreate (MyActivity.java: 84) the 'e / a droidRuntime (9580): on android.app.Activity.performCreate (Activity.java:5122) e / AndroidRuntime (9580): android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1081) e / AndroidRuntime (9580): In Android.app.activatrid.forstream launch activity (activityTrad.Java22 77) E / Android Rentman (9580) ... 11 and E / app ether Delog (503): Aieloovrstorejhandl failed to get instance    

Notafford exceptions is normal. This means no barcode was found in the image. You have to handle it, yes your image has been rotated to 90 degrees and by default the barcode is normally seen.

You can actually use IntentIntegrator if you can do this work, and saves you to understand all these things again.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -