hlgranite / WarehouseBarcode

An barcode system help to keep track warehouse stock.
MIT License
0 stars 0 forks source link

Scan barcode #14

Closed yancyn closed 10 years ago

yancyn commented 11 years ago

Add barcode scanning ability to allow user to scan barcode with front camera by integrating ZXing sdk into application.

yancyn commented 10 years ago

Add core-2.2.jar & android-integration-2.2.jar into library in compile & gradle (if has). Then apply the code below

IntentIntegrator integrator = new IntentIntegrator(yourActivity);
integrator.initiateScan();
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
  IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
  if (scanResult != null) {
    // handle scan result
  }
  // else continue with any other code you need in the method
  ...
}

see source