Android / ZXing no longer works

My application uses the ZXing barcode scanner using the ZXing helper classes IntentIntegrator and IntentResult.

Now I found that there are no more scan results sent from ZXing, the associated return values ​​are empty / null.

So I updated to the latest helper classes http://code.google.com/p/zxing/source/browse/trunk/android-integration/src/com/google/zxing/integration/android/IntentIntegrator.java and http : //code.google.com/p/zxing/source/browse/trunk/android-integration/src/com/google/zxing/integration/android/IntentResult.java

Now my onActivityResult method is called immediately after starting ZXing - of course, with an empty result again.

My code is pretty simple, the scan starts like this:

if (v==scanButton) { com.google.zxing.integration.android.IntentIntegrator integrator = new IntentIntegrator(this); integrator.initiateScan(); } 

and getting the results this way:

 public void onActivityResult(int requestCode, int resultCode, Intent intent) { com.google.zxing.integration.android.IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent); if (scanResult != null) { String format; format=scanResult.getFormatName(); if ((format!=null) && (format.length()>0)) { if ((format.equals("EAN_8")) || (format.equals("EAN_13")) ||(format.equals("UPC_A")) ||(format.equals("UPC_E"))) getEANData(scanResult.getContents()); } } } 

My android has the latest ZXing code installed. Any ideas why this is no longer working?

+4
source share
1 answer

From what I found out in the meantime: this seems to be an installation dependent issue. On my Android device, I see this problem, but it does not play, other users of my application do not experience this. The ZXing code itself has not been changed for a longer time, and users confirm that it works too - so this seems like a very ugly mistake.

Here it happens with the ZXing code installed from the Playstore, have not tested it yet with the ZXing included in my application ...

+1
source

Source: https://habr.com/ru/post/1440994/


All Articles