title: Integrating ZbarScanner with android app
body: <p>I am developing a mobile app to integrate with ZbarScanner. However, I am meet with error "ZBarScannerActivity cannot be resolved to a type" and "ZBarConstants cannot be resolved to a variable". please assist to help with the following code:</p>
  
  <p><strong>MainActivity.java:</strong></p>
  
  <pre><code>package com.example.vscanner;
  
  import net.sourceforge.zbar.Symbol;
  import android.os.Bundle;
  import android.app.Activity;
  import android.content.Intent;
  import android.content.pm.PackageManager;
  import android.view.Menu;
  import android.view.View;
  import android.widget.Toast;
  
  public class MainActivity extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
      }
      private static final int ZBAR_SCANNER_REQUEST = 0;
        private static final int ZBAR_QR_SCANNER_REQUEST = 1;
  
      public void launchScanner(View v) {
          if (isCameraAvailable()) {
              Intent intent = new Intent(this, ZBarScannerActivity.class);
              startActivityForResult(intent, ZBAR_SCANNER_REQUEST);
          } else {
              Toast.makeText(this, "Rear Facing Camera Unavailable", Toast.LENGTH_SHORT).show();
          }
      }
  
      public void launchQRScanner(View v) {
          if (isCameraAvailable()) {
              Intent intent = new Intent(this, ZBarScannerActivity.class);
              intent.putExtra(ZBarConstants.SCAN_MODES, new int[]{Symbol.QRCODE});
              startActivityForResult(intent, ZBAR_SCANNER_REQUEST);
          } else {
              Toast.makeText(this, "Rear Facing Camera Unavailable", Toast.LENGTH_SHORT).show();
          }
      }
  
      public boolean isCameraAvailable() {
          PackageManager pm = getPackageManager();
          return pm.hasSystemFeature(PackageManager.FEATURE_CAMERA);
      }
  
      @Override
      protected void onActivityResult(int requestCode, int resultCode, Intent data)
      {    
          if (resultCode == RESULT_OK) 
          {
              // Scan result is available by making a call to data.getStringExtra(ZBarConstants.SCAN_RESULT)
              // Type of the scan result is available by making a call to data.getStringExtra(ZBarConstants.SCAN_RESULT_TYPE)
              Toast.makeText(this, "Scan Result = " + data.getStringExtra(ZBarConstants.SCAN_RESULT), Toast.LENGTH_SHORT).show();
              Toast.makeText(this, "Scan Result Type = " + data.getStringExtra(ZBarConstants.SCAN_RESULT_TYPE), Toast.LENGTH_SHORT).show();
              // The value of type indicates one of the symbols listed in Advanced Options below.
          } else if(resultCode == RESULT_CANCELED) {
              Toast.makeText(this, "Camera unavailable", Toast.LENGTH_SHORT).show();
          }
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
      }
  }
  </code></pre>