<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
- <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
- <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+ <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+ <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+ <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
+ <classpathentry kind="lib" path="/home/miles/Documents/Testing/ZXing-2.2.zip"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
package com.jaiswallab.lab.inventory;
-import android.os.Bundle;
import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
+
+
public class MainActivity extends Activity {
private EditText text;
// This method is called at click of the QR code button
public void qrClick(View view) {
text.setText("QR button clicked again");
+ Intent intent = new Intent("com.google.zxing.client.android.SCAN");
+ startActivityForResult(intent, 0);
+ }
+
+ public void onActivityResult(int requestCode, int resultCode, Intent intent) {
+ if (requestCode == 0) {
+ if (resultCode == RESULT_OK) {
+ // contents contains whatever was encoded
+ String contents = intent.getStringExtra("SCAN_RESULT");
+ text.setText(contents);
+ // Format contains the type of code i.e. UPC, EAN, QRCode etc...
+ String format = intent.getStringExtra("SCAN_RESULT_FORMAT");
+
+
+ }
+ }
+
}
// This method is called at click of the check inventory button