Barcode image Scanner
<p>I am new to android. I am trying to develop a barcode scanner, that works as follow:
Take image(of barcode) via camera and scan this barcode image.
my question is how i can do it?
Thanks in advance</p>

<p>Here is my code:</p>

<pre><code>TextView result_text;
Button scan_btn;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    result_text = (TextView)findViewById(R.id.Result_tv);

    scan_btn = (Button)findViewById(R.id.Barcode_Scan_Button);
    scan_btn.setOnClickListener( new View.OnClickListener() {

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

            startActivityForResult(scanIntent, 0);

        }
    });
}

public void onActivityResult(int requestCode, int resultCode, Intent intent) {

        if (requestCode == 0) {


          if (resultCode == RESULT_OK) {

            result_text.setText(intent.getStringExtra("SCAN_RESULT"));

          } else if (resultCode == RESULT_CANCELED) {

            result_text.setText("Scan cancelled.");

          }

        }

      }

    }
</code></pre>
