From: miles Date: Tue, 17 Sep 2013 21:00:49 +0000 (+0000) Subject: first try at integrating google's barcode scanner X-Git-Url: http://gitweb.planteome.org/?a=commitdiff_plain;h=7e4ab08de083e9967ae639d6ba289435d432d132;p=old-jaiswallab-svn%2F.git first try at integrating google's barcode scanner svn path=/; revision=499 --- diff --git a/Personnel/justin/lab inventory/.classpath b/Personnel/justin/lab inventory/.classpath index a4763d1..7b60a9d 100644 --- a/Personnel/justin/lab inventory/.classpath +++ b/Personnel/justin/lab inventory/.classpath @@ -2,7 +2,9 @@ - - + + + + diff --git a/Personnel/justin/lab inventory/AndroidManifest.xml b/Personnel/justin/lab inventory/AndroidManifest.xml index ba8b695..133dfcb 100644 --- a/Personnel/justin/lab inventory/AndroidManifest.xml +++ b/Personnel/justin/lab inventory/AndroidManifest.xml @@ -5,7 +5,7 @@ + android:targetSdkVersion="18" /> + android:targetSdkVersion="18" /> # Encoding is UTF-8 diff --git a/Personnel/justin/lab inventory/bin/lab inventory.apk b/Personnel/justin/lab inventory/bin/lab inventory.apk index 1684cb3..e9b9df1 100644 Binary files a/Personnel/justin/lab inventory/bin/lab inventory.apk and b/Personnel/justin/lab inventory/bin/lab inventory.apk differ diff --git a/Personnel/justin/lab inventory/bin/res/crunch/drawable-hdpi/ic_action_search.png b/Personnel/justin/lab inventory/bin/res/crunch/drawable-hdpi/ic_action_search.png new file mode 100644 index 0000000..ffec9be Binary files /dev/null and b/Personnel/justin/lab inventory/bin/res/crunch/drawable-hdpi/ic_action_search.png differ diff --git a/Personnel/justin/lab inventory/bin/res/crunch/drawable-hdpi/ic_launcher.png b/Personnel/justin/lab inventory/bin/res/crunch/drawable-hdpi/ic_launcher.png new file mode 100644 index 0000000..498a287 Binary files /dev/null and b/Personnel/justin/lab inventory/bin/res/crunch/drawable-hdpi/ic_launcher.png differ diff --git a/Personnel/justin/lab inventory/bin/res/crunch/drawable-ldpi/ic_launcher.png b/Personnel/justin/lab inventory/bin/res/crunch/drawable-ldpi/ic_launcher.png new file mode 100644 index 0000000..7d9eba3 Binary files /dev/null and b/Personnel/justin/lab inventory/bin/res/crunch/drawable-ldpi/ic_launcher.png differ diff --git a/Personnel/justin/lab inventory/bin/res/crunch/drawable-mdpi/ic_action_search.png b/Personnel/justin/lab inventory/bin/res/crunch/drawable-mdpi/ic_action_search.png new file mode 100644 index 0000000..ce9399c Binary files /dev/null and b/Personnel/justin/lab inventory/bin/res/crunch/drawable-mdpi/ic_action_search.png differ diff --git a/Personnel/justin/lab inventory/bin/res/crunch/drawable-mdpi/ic_launcher.png b/Personnel/justin/lab inventory/bin/res/crunch/drawable-mdpi/ic_launcher.png new file mode 100644 index 0000000..9eb7580 Binary files /dev/null and b/Personnel/justin/lab inventory/bin/res/crunch/drawable-mdpi/ic_launcher.png differ diff --git a/Personnel/justin/lab inventory/bin/res/crunch/drawable-xhdpi/ic_action_search.png b/Personnel/justin/lab inventory/bin/res/crunch/drawable-xhdpi/ic_action_search.png new file mode 100644 index 0000000..b2d7b2d Binary files /dev/null and b/Personnel/justin/lab inventory/bin/res/crunch/drawable-xhdpi/ic_action_search.png differ diff --git a/Personnel/justin/lab inventory/bin/res/crunch/drawable-xhdpi/ic_launcher.png b/Personnel/justin/lab inventory/bin/res/crunch/drawable-xhdpi/ic_launcher.png new file mode 100644 index 0000000..cd07610 Binary files /dev/null and b/Personnel/justin/lab inventory/bin/res/crunch/drawable-xhdpi/ic_launcher.png differ diff --git a/Personnel/justin/lab inventory/bin/resources.ap_ b/Personnel/justin/lab inventory/bin/resources.ap_ index 21c32bb..1f3049b 100644 Binary files a/Personnel/justin/lab inventory/bin/resources.ap_ and b/Personnel/justin/lab inventory/bin/resources.ap_ differ diff --git a/Personnel/justin/lab inventory/project.properties b/Personnel/justin/lab inventory/project.properties index 9b84a6b..ce39f2d 100644 --- a/Personnel/justin/lab inventory/project.properties +++ b/Personnel/justin/lab inventory/project.properties @@ -11,4 +11,4 @@ #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt # Project target. -target=android-16 +target=android-18 diff --git a/Personnel/justin/lab inventory/src/com/jaiswallab/lab/inventory/MainActivity.java b/Personnel/justin/lab inventory/src/com/jaiswallab/lab/inventory/MainActivity.java index 396f6b4..566c58e 100644 --- a/Personnel/justin/lab inventory/src/com/jaiswallab/lab/inventory/MainActivity.java +++ b/Personnel/justin/lab inventory/src/com/jaiswallab/lab/inventory/MainActivity.java @@ -1,11 +1,14 @@ 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; @@ -25,6 +28,23 @@ public class MainActivity extends Activity { // 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