Q:

How to Retrieve product id from bar code? 

I have used the same way of Zxing Intent to open scanner from my application.  But my application just opens scanner and does nothing.  Also, I am getting some FileNotfoundException.   
Do I have to add any permission in manifest? 
This is my class where I use Intent:
public class BarCodes extends Activity {

   /** Called when the activity is first created. */ 
   @Override public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
      Button ok;

      ok=(Button) findViewById(R.id.b1);
      ok.setOnClickListener(new View. OnClickListener() {  

         @Override public void onClick(View v) {
            // TODO Auto-generated method stub
            Intent intent = new Intent("com.google.zxing.client.android. SCAN");
            intent.setPackage("com.google.zxing.client.android");
            intent.putExtra("SCAN_MODE","QR_CODE_MODE");
            startActivityForResult(intent, 0);
         }

      });
      System.out.println("SSSSSSSSSSSSS");
   }

   public void onActivityResult(int requestCode, int resultCode, Intent intent) {
      if (requestCode == 0) {   
          if (resultCode == RESULT_OK) {
              String contents = intent.getStringExtra("SCAN_RESULT");
              System.out.println("contentsssssssssssssssssssssss" + contents);
              String format = intent.getStringExtra("SCAN_RESULT_FORMAT");
              // Handle successful scan
          } else if (resultCode == RESULT_CANCELED) {
              // Handle cancel
          }
       }
    }
}

Also LogCat is here:
java.lang. RunTimeException:Unable to instantiate activity componentInfo{com.pkg. BarCode...}  
caused by : java.lang.classNotFoundException:com.pkg. Scan in loader dalvik. System   Loader…  

What might be the problem??   

A:

Steps:  

Install Apache Ant (http://www.youtube.com/watch?v=XJmndRfb1TU , this video will help you to do that) and also refer http://ant.apache.org/ for more info and download ant  
Download the ZXing source from ZXing homepage and extract it (For More info :http://code.google.com/p/zxing/source/browse/trunk/android/)  
With the use of Windows Commandline (Run->CMD) navigate to the extracted directory   
Type  'ant -f core/build.xml' or  'ant -f android/build.xml'   
Enter Eclipse -> new Android Project  
Right-click project folder -> Properties -> Java Build Path -> Library -> Add External JARs  
If the Barcode Scanner is installed on your Android device, you can have it scan for you and return the result, just by sending it an Intent.  For example, you can hook up a button to scan a QR code in this way    
It will have the product code Stored in the String value 'contents'
Have fun with BarCode by implementing it in your own way :-)  

