user1025050
user1025050

Reputation:

Implementing Barcode Scanner

I am developing an app in which i have to use Barcode Scanner to scan Barcode and after lot of search i got the following code:

 Intent intent = new Intent("com.google.zxing.client.android.SCAN");

With the help of this code , user can implement barcode scanner of Zxing but i want to implement my barcode scanner programmatically that is i don't want a third party application. I used Integrating the ZXing library directly into my Android application link to make standalone barcode scanner but i don't know what to do after making core.jar Kindly help me to integrate barcode scanner. Any help will be appreciated.. Thanks in advance

Upvotes: 1

Views: 3038

Answers (1)

Mattias Isegran Bergander
Mattias Isegran Bergander

Reputation: 11909

Launch activity for result instead or just the convenience code for this:

IntentIntegrator integrator = new IntentIntegrator(yourActivity);
integrator.initiateScan();

and have this method to receive the result:

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
  ...
}

Please refer to this link for more information:

http://code.google.com/p/zxing/wiki/ScanningViaIntent

Upvotes: 2

Related Questions