android - How to trigger bulk mode scan in zxing -


i read there key enable bulk mode scan in zxing. may know how enable key in android application?

i using such codes scan barcode individually:

intent intent = new intent("com.google.zxing.client.android.scan"); intent.putextra("scan_formats", "product_mode,code_39,code_93,code_128,data_matrix,itf");  startactivityforresult(intent, 0); // start scan 

thanks!

there no concept of "bulk mode" within zxing don't think.

you can implement behavior looking though zxing inside own application. use code have in question kick of scanning first time. add declaration class:

arraylist<string> results; 

then add inside oncreate before start scanning initialize it:

results = new arraylist<string>(); 

inside onactivityresult() can add current result arraylist , start next scan.

/*here come after barcode scanner done*/ public void onactivityresult(int requestcode, int resultcode, intent intent) {     if (requestcode == 0) {         if (resultcode == result_ok) {             // contents contains whatever code             string contents = intent.getstringextra("scan_result");              // format contains type of code i.e. upc, ean, qrcode etc...             string format = intent.getstringextra("scan_result_format");              // handle successful scan. in example add contents arraylist             results.add(contents);              intent intent = new intent("com.google.zxing.client.android.scan");             intent.putextra("scan_formats", "product_mode,code_39,code_93,code_128,data_matrix,itf");             startactivityforresult(intent, 0); // start next scan         } else if (resultcode == result_canceled) {             // user hass pressed 'back' instead of scanning. done.             savetocsv(results);             //do whatever else want.         }     } } 

saving them csv file beyond scope of specific question, if around can find examples of how it. consider left blank exercise learn from.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -