Hello!

To see the file structure, click on "tree".

Note that updates take place every 10 minutes, commits may not be seen immediately.
added multiple screens (activities), switching mechanism
authormiles <miles@localhost>
Fri, 25 Oct 2013 20:20:13 +0000 (20:20 +0000)
committermiles <miles@localhost>
Fri, 25 Oct 2013 20:20:13 +0000 (20:20 +0000)
updated buttons (different looks when pressed)
fixed some crash errors
new icon!
started adding items via the app
fixed some bugs that were causing data to be switched around

svn path=/; revision=514

34 files changed:
Personnel/justin/lab inventory/AndroidManifest.xml
Personnel/justin/lab inventory/bin/AndroidManifest.xml [new file with mode: 0644]
Personnel/justin/lab inventory/bin/classes.dex [new file with mode: 0644]
Personnel/justin/lab inventory/bin/jarlist.cache [new file with mode: 0644]
Personnel/justin/lab inventory/bin/lab inventory.apk [new file with mode: 0644]
Personnel/justin/lab inventory/bin/res/crunch/drawable-hdpi/ic_action_search.png [new file with mode: 0644]
Personnel/justin/lab inventory/bin/res/crunch/drawable-hdpi/ic_launcher.png [new file with mode: 0644]
Personnel/justin/lab inventory/bin/res/crunch/drawable-hdpi/light_grey_button.png [new file with mode: 0644]
Personnel/justin/lab inventory/bin/res/crunch/drawable-ldpi/ic_launcher.png [new file with mode: 0644]
Personnel/justin/lab inventory/bin/res/crunch/drawable-ldpi/light_grey_button.png [new file with mode: 0644]
Personnel/justin/lab inventory/bin/res/crunch/drawable-mdpi/ic_action_search.png [new file with mode: 0644]
Personnel/justin/lab inventory/bin/res/crunch/drawable-mdpi/ic_launcher.png [new file with mode: 0644]
Personnel/justin/lab inventory/bin/res/crunch/drawable-mdpi/light_grey_button.png [new file with mode: 0644]
Personnel/justin/lab inventory/bin/res/crunch/drawable-xhdpi/ic_action_search.png [new file with mode: 0644]
Personnel/justin/lab inventory/bin/res/crunch/drawable-xhdpi/ic_launcher.png [new file with mode: 0644]
Personnel/justin/lab inventory/bin/res/crunch/drawable-xhdpi/light_grey_button.png [new file with mode: 0644]
Personnel/justin/lab inventory/bin/resources.ap_ [new file with mode: 0644]
Personnel/justin/lab inventory/res/drawable-hdpi/ic_launcher.png
Personnel/justin/lab inventory/res/drawable-hdpi/light_grey_button.png [new file with mode: 0644]
Personnel/justin/lab inventory/res/drawable-hdpi/update_button.xml
Personnel/justin/lab inventory/res/drawable-ldpi/ic_launcher.png
Personnel/justin/lab inventory/res/drawable-ldpi/light_grey_button.png [new file with mode: 0644]
Personnel/justin/lab inventory/res/drawable-ldpi/update_button.xml
Personnel/justin/lab inventory/res/drawable-mdpi/ic_launcher.png
Personnel/justin/lab inventory/res/drawable-mdpi/light_grey_button.png [new file with mode: 0644]
Personnel/justin/lab inventory/res/drawable-mdpi/update_button.xml
Personnel/justin/lab inventory/res/drawable-xhdpi/ic_launcher.png
Personnel/justin/lab inventory/res/drawable-xhdpi/light_grey_button.png [new file with mode: 0644]
Personnel/justin/lab inventory/res/drawable-xhdpi/update_button.xml
Personnel/justin/lab inventory/res/layout/activity_add.xml [new file with mode: 0644]
Personnel/justin/lab inventory/res/layout/activity_main.xml
Personnel/justin/lab inventory/res/values/strings.xml
Personnel/justin/lab inventory/src/com/jaiswallab/lab/inventory/ItemCreationActivity.java [new file with mode: 0644]
Personnel/justin/lab inventory/src/com/jaiswallab/lab/inventory/MainActivity.java

index e31fedc95eb69ccfdd4636a8816bab4155a4feb5..a6ca9432466c120a7e0a9dcd3fd5722b7c5af785 100644 (file)
 
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
+        </activity>
+                <activity
+            android:label="Add Item"
+            android:name=".ItemCreationActivity" >
         </activity>
     </application>
 
diff --git a/Personnel/justin/lab inventory/bin/AndroidManifest.xml b/Personnel/justin/lab inventory/bin/AndroidManifest.xml
new file mode 100644 (file)
index 0000000..a6ca943
--- /dev/null
@@ -0,0 +1,35 @@
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.jaiswallab.lab.inventory"
+    android:versionCode="1"
+    android:versionName="1.0" >
+    
+    <uses-sdk
+        android:minSdkVersion="8"
+        android:targetSdkVersion="18" />
+    
+    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
+    <uses-permission android:name="android.permission.INTERNET"/>
+    <uses-permission android:name="android.permission.READ_CALENDAR"/>
+
+    <application
+        android:icon="@drawable/ic_launcher"
+        android:label="@string/app_name"
+        android:theme="@style/AppTheme" >
+        <activity
+            android:name=".MainActivity"
+            android:label="@string/title_activity_main" >
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+                <activity
+            android:label="Add Item"
+            android:name=".ItemCreationActivity" >
+        </activity>
+    </application>
+
+    
+</manifest>
\ No newline at end of file
diff --git a/Personnel/justin/lab inventory/bin/classes.dex b/Personnel/justin/lab inventory/bin/classes.dex
new file mode 100644 (file)
index 0000000..a30e0d6
Binary files /dev/null and b/Personnel/justin/lab inventory/bin/classes.dex differ
diff --git a/Personnel/justin/lab inventory/bin/jarlist.cache b/Personnel/justin/lab inventory/bin/jarlist.cache
new file mode 100644 (file)
index 0000000..0565465
--- /dev/null
@@ -0,0 +1,3 @@
+# cache for current jar dependency. DO NOT EDIT.
+# format is <lastModified> <length> <SHA-1> <path>
+# Encoding is UTF-8
diff --git a/Personnel/justin/lab inventory/bin/lab inventory.apk b/Personnel/justin/lab inventory/bin/lab inventory.apk
new file mode 100644 (file)
index 0000000..d1ddb00
Binary files /dev/null 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 (file)
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 (file)
index 0000000..fbed22c
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-hdpi/light_grey_button.png b/Personnel/justin/lab inventory/bin/res/crunch/drawable-hdpi/light_grey_button.png
new file mode 100644 (file)
index 0000000..e6b0b8c
Binary files /dev/null and b/Personnel/justin/lab inventory/bin/res/crunch/drawable-hdpi/light_grey_button.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 (file)
index 0000000..fbed22c
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-ldpi/light_grey_button.png b/Personnel/justin/lab inventory/bin/res/crunch/drawable-ldpi/light_grey_button.png
new file mode 100644 (file)
index 0000000..e6b0b8c
Binary files /dev/null and b/Personnel/justin/lab inventory/bin/res/crunch/drawable-ldpi/light_grey_button.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 (file)
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 (file)
index 0000000..fbed22c
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-mdpi/light_grey_button.png b/Personnel/justin/lab inventory/bin/res/crunch/drawable-mdpi/light_grey_button.png
new file mode 100644 (file)
index 0000000..e6b0b8c
Binary files /dev/null and b/Personnel/justin/lab inventory/bin/res/crunch/drawable-mdpi/light_grey_button.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 (file)
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 (file)
index 0000000..fbed22c
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/res/crunch/drawable-xhdpi/light_grey_button.png b/Personnel/justin/lab inventory/bin/res/crunch/drawable-xhdpi/light_grey_button.png
new file mode 100644 (file)
index 0000000..e6b0b8c
Binary files /dev/null and b/Personnel/justin/lab inventory/bin/res/crunch/drawable-xhdpi/light_grey_button.png differ
diff --git a/Personnel/justin/lab inventory/bin/resources.ap_ b/Personnel/justin/lab inventory/bin/resources.ap_
new file mode 100644 (file)
index 0000000..d3e0b79
Binary files /dev/null and b/Personnel/justin/lab inventory/bin/resources.ap_ differ
index 4e9c3d9bd9c06b6bf299b7c47b6715794b15709c..fc58b04d4252dd26f02150300775a6713ef4ab2a 100644 (file)
Binary files a/Personnel/justin/lab inventory/res/drawable-hdpi/ic_launcher.png and b/Personnel/justin/lab inventory/res/drawable-hdpi/ic_launcher.png differ
diff --git a/Personnel/justin/lab inventory/res/drawable-hdpi/light_grey_button.png b/Personnel/justin/lab inventory/res/drawable-hdpi/light_grey_button.png
new file mode 100644 (file)
index 0000000..6e97a65
Binary files /dev/null and b/Personnel/justin/lab inventory/res/drawable-hdpi/light_grey_button.png differ
index cc50636249e0461187e95e44c3f6df841feec9f9..4ee40e396da8d9a09fc74a46b53ed50bb6fa923b 100644 (file)
@@ -1,4 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <selector xmlns:android="http://schemas.android.com/apk/res/android" >
-<item  android:drawable="@drawable/grey_button"></item>
+  <item android:state_pressed="true"
+   android:drawable="@drawable/light_grey_button" /> <!-- pressed -->
+  <item  android:drawable="@drawable/grey_button"/>
 </selector>
\ No newline at end of file
index e01f783aa72d3c26871db18ca648f150e4f3f36a..fc58b04d4252dd26f02150300775a6713ef4ab2a 100644 (file)
Binary files a/Personnel/justin/lab inventory/res/drawable-ldpi/ic_launcher.png and b/Personnel/justin/lab inventory/res/drawable-ldpi/ic_launcher.png differ
diff --git a/Personnel/justin/lab inventory/res/drawable-ldpi/light_grey_button.png b/Personnel/justin/lab inventory/res/drawable-ldpi/light_grey_button.png
new file mode 100644 (file)
index 0000000..6e97a65
Binary files /dev/null and b/Personnel/justin/lab inventory/res/drawable-ldpi/light_grey_button.png differ
index cc50636249e0461187e95e44c3f6df841feec9f9..17efd8cee7919affe583bbc1d4ed47534a6353ea 100644 (file)
@@ -1,4 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <selector xmlns:android="http://schemas.android.com/apk/res/android" >
 <item  android:drawable="@drawable/grey_button"></item>
+  <item android:state_pressed="true"
+   android:drawable="@drawable/light_grey_button" /> <!-- pressed -->
 </selector>
\ No newline at end of file
index 0abbc80254fda430a4bbe2d0003818ff9df9d863..fc58b04d4252dd26f02150300775a6713ef4ab2a 100644 (file)
Binary files a/Personnel/justin/lab inventory/res/drawable-mdpi/ic_launcher.png and b/Personnel/justin/lab inventory/res/drawable-mdpi/ic_launcher.png differ
diff --git a/Personnel/justin/lab inventory/res/drawable-mdpi/light_grey_button.png b/Personnel/justin/lab inventory/res/drawable-mdpi/light_grey_button.png
new file mode 100644 (file)
index 0000000..6e97a65
Binary files /dev/null and b/Personnel/justin/lab inventory/res/drawable-mdpi/light_grey_button.png differ
index cc50636249e0461187e95e44c3f6df841feec9f9..17efd8cee7919affe583bbc1d4ed47534a6353ea 100644 (file)
@@ -1,4 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <selector xmlns:android="http://schemas.android.com/apk/res/android" >
 <item  android:drawable="@drawable/grey_button"></item>
+  <item android:state_pressed="true"
+   android:drawable="@drawable/light_grey_button" /> <!-- pressed -->
 </selector>
\ No newline at end of file
index 4cb8ab0eb8c266c2efb93f31a3c492f238e4b179..fc58b04d4252dd26f02150300775a6713ef4ab2a 100644 (file)
Binary files a/Personnel/justin/lab inventory/res/drawable-xhdpi/ic_launcher.png and b/Personnel/justin/lab inventory/res/drawable-xhdpi/ic_launcher.png differ
diff --git a/Personnel/justin/lab inventory/res/drawable-xhdpi/light_grey_button.png b/Personnel/justin/lab inventory/res/drawable-xhdpi/light_grey_button.png
new file mode 100644 (file)
index 0000000..6e97a65
Binary files /dev/null and b/Personnel/justin/lab inventory/res/drawable-xhdpi/light_grey_button.png differ
index cc50636249e0461187e95e44c3f6df841feec9f9..17efd8cee7919affe583bbc1d4ed47534a6353ea 100644 (file)
@@ -1,4 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <selector xmlns:android="http://schemas.android.com/apk/res/android" >
 <item  android:drawable="@drawable/grey_button"></item>
+  <item android:state_pressed="true"
+   android:drawable="@drawable/light_grey_button" /> <!-- pressed -->
 </selector>
\ No newline at end of file
diff --git a/Personnel/justin/lab inventory/res/layout/activity_add.xml b/Personnel/justin/lab inventory/res/layout/activity_add.xml
new file mode 100644 (file)
index 0000000..e7b6b5a
--- /dev/null
@@ -0,0 +1,76 @@
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/light_blue" >
+
+    <EditText
+        android:id="@+id/addInfo1"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignLeft="@+id/addInfo2"
+        android:layout_alignParentRight="true"
+        android:layout_alignParentTop="true"
+        android:layout_marginTop="64dp"
+        android:ems="10" />
+
+    <Button
+        android:id="@+id/Button01"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_centerHorizontal="true"
+        android:layout_centerVertical="true"
+        android:background="@drawable/green_button"
+        android:onClick="createClick"
+        android:text="Create" />
+
+    <EditText
+        android:id="@+id/addInfo3"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignLeft="@+id/Button01"
+        android:layout_alignParentRight="true"
+        android:layout_below="@+id/addInfo2"
+        android:ems="10" />
+
+    <EditText
+        android:id="@+id/addInfo2"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignLeft="@+id/addInfo3"
+        android:layout_alignParentRight="true"
+        android:layout_below="@+id/addInfo1"
+        android:ems="10" />
+
+    <TextView
+        android:id="@+id/label1"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignBaseline="@+id/addInfo1"
+        android:layout_alignBottom="@+id/addInfo1"
+        android:layout_marginRight="14dp"
+        android:layout_toLeftOf="@+id/addInfo1"
+        android:text="Type:"
+        android:textAppearance="?android:attr/textAppearanceSmall" />
+
+    <TextView
+        android:id="@+id/label2"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignBaseline="@+id/addInfo2"
+        android:layout_alignBottom="@+id/addInfo2"
+        android:layout_alignRight="@+id/label1"
+        android:text="Quantity:"
+        android:textAppearance="?android:attr/textAppearanceSmall" />
+
+    <TextView
+        android:id="@+id/label3"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignBaseline="@+id/addInfo3"
+        android:layout_alignBottom="@+id/addInfo3"
+        android:layout_alignRight="@+id/label2"
+        android:text="Curator Name:"
+        android:textAppearance="?android:attr/textAppearanceSmall" />
+
+</RelativeLayout>
\ No newline at end of file
index a9c8ca7f72b5ee621235d66a29855293802628b5..e642aeb92d842668dc399332168f26cfd3f6d3b7 100644 (file)
         android:layout_below="@+id/editText2"
         android:ems="10" />
 
-    <EditText
-        android:id="@+id/editText1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentRight="true"
-        android:layout_below="@+id/button2"
-        android:ems="10" />
-
-    <Button
-        android:id="@+id/button2"
-        style="?android:attr/buttonStyleSmall"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_below="@+id/button1"
-        android:layout_toLeftOf="@+id/editText2"
-        android:onClick="updateInventoryItem"
-        android:background="@drawable/update_button"
-        android:text="Update Item" />
-
     <EditText
         android:id="@+id/editText4"
         android:layout_width="wrap_content"
         android:layout_below="@+id/editText4"
         android:ems="10" />
 
-    <Button
-        android:id="@+id/button3"
-        style="?android:attr/buttonStyleSmall"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentRight="true"
-        android:layout_below="@+id/editText5"
-        android:onClick="viewMoreInformation"
-        android:text="More Information" />
-
     <TextView
-        android:id="@+id/textView1"
+        android:id="@+id/label1"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_alignBottom="@+id/editText1"
         android:textAppearance="?android:attr/textAppearanceSmall" />
 
     <TextView
-        android:id="@+id/TextView01"
+        android:id="@+id/label4"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_alignBottom="@+id/editText2"
-        android:layout_alignLeft="@+id/textView1"
+        android:layout_alignLeft="@+id/label1"
         android:text="Room:"
         android:textAppearance="?android:attr/textAppearanceSmall" />
 
     <TextView
-        android:id="@+id/TextView04"
+        android:id="@+id/label5"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_alignBottom="@+id/editText3"
-        android:layout_alignLeft="@+id/TextView01"
+        android:layout_alignLeft="@+id/label4"
         android:text="Cupboard:"
         android:textAppearance="?android:attr/textAppearanceSmall" />
 
     <TextView
-        android:id="@+id/TextView03"
+        android:id="@+id/label3"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_above="@+id/editText5"
-        android:layout_alignLeft="@+id/TextView04"
+        android:layout_alignLeft="@+id/label5"
         android:text="Freezer:"
         android:textAppearance="?android:attr/textAppearanceSmall" />
 
     <TextView
-        android:id="@+id/TextView02"
+        android:id="@+id/label2"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_alignBottom="@+id/editText5"
-        android:layout_alignLeft="@+id/TextView03"
+        android:layout_alignLeft="@+id/label3"
         android:text="Shelf:"
         android:textAppearance="?android:attr/textAppearanceSmall" />
 
+    <EditText
+        android:id="@+id/editText1"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentRight="true"
+        android:layout_below="@+id/button1"
+        android:ems="10" />
+
     <Button
-        android:id="@+id/button1"
+        android:id="@+id/button2"
+        style="?android:attr/buttonStyleSmall"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignBaseline="@+id/button3"
+        android:layout_alignBottom="@+id/button3"
+        android:layout_alignParentLeft="true"
+        android:layout_marginLeft="20dp"
+        android:background="@drawable/update_button"
+        android:onClick="updateInventoryItem"
+        android:text="Update Item" />
+
+    <Button
+        android:id="@+id/button3"
+        style="?android:attr/buttonStyleSmall"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_alignParentRight="true"
+        android:layout_below="@+id/editText5"
+        android:layout_marginTop="34dp"
+        android:onClick="viewMoreInformation"
+        android:text="More Information" />
+
+    <Button
+        android:id="@+id/button1"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignLeft="@+id/button3"
         android:layout_alignParentTop="true"
-        android:layout_marginRight="10dp"
-        android:layout_marginTop="10dp"
         android:background="@drawable/green_button"
         android:onClick="recognizeQRClick"
         android:text="@string/recognize_qr_button" />
 
+    <Button
+        android:id="@+id/Button01"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_above="@+id/editText1"
+        android:layout_alignRight="@+id/button2"
+        android:background="@drawable/green_button"
+        android:onClick="newItemClick"
+        android:text="New Item" />
+
 </RelativeLayout>
\ No newline at end of file
index 58e05b7e1df9cf148fbb66b262a2b6db8fcad3fa..385d9c2a46892f80bb7cd9a481c1796af52fddf2 100644 (file)
@@ -9,6 +9,6 @@
     <string name="recognize_qr_button">New Scan</string>
     <string name="print_qr_button">Print new QR</string>
     <color name="light_green">#9962B1D0</color>
-    <color name="light_blue">#FF4282D3</color>
+    <color name="light_blue">#5ED0DB</color>
     
 </resources>
\ No newline at end of file
diff --git a/Personnel/justin/lab inventory/src/com/jaiswallab/lab/inventory/ItemCreationActivity.java b/Personnel/justin/lab inventory/src/com/jaiswallab/lab/inventory/ItemCreationActivity.java
new file mode 100644 (file)
index 0000000..6614b23
--- /dev/null
@@ -0,0 +1,105 @@
+package com.jaiswallab.lab.inventory;
+
+import android.os.Bundle;
+import java.io.BufferedReader;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+import java.util.Calendar;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.DefaultHttpClient;
+
+import com.jaiswallab.lab.inventory.ItemCreationActivity.HttpGetTask;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.net.Uri;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.view.Menu;
+import android.view.View;
+import android.widget.EditText;
+
+
+public class ItemCreationActivity extends Activity {
+       EditText text1;
+       EditText text2;
+       EditText text3;
+       Activity alt_this = this;
+       
+       public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_add);
+        text1 = (EditText) findViewById(R.id.addInfo1);
+        text2 = (EditText) findViewById(R.id.addInfo2);
+        text3 = (EditText) findViewById(R.id.addInfo3);
+       }
+       
+       public void createClick(View view) {
+               String params = "";
+               if((text1.getText() != null) && (!text1.getText().equals(""))) {
+                       params = params + "&type=" + text1.getText();
+               }
+               if((text2.getText() != null) && (!text2.getText().equals(""))) {
+                       params = params + "&quantity=" + text2.getText();
+               }
+               if((text3.getText() != null) && (!text3.getText().equals(""))) {
+                       params = params + "&name=" + text3.getText();
+               }
+               
+                Intent itemCreation = new Intent(alt_this, MainActivity.class);
+                startActivity(itemCreation);
+               //String url = "http://jaiswallab.cgrb.oregonstate.edu/inventory/edit_item.php?" + params;
+                       //new HttpGetTask().execute(url);
+       }
+       
+       public class HttpGetTask extends AsyncTask<String, Integer, String> {
+               String result = "Failed: Invalid QR Code";
+               
+            protected String doInBackground(String... urls) {
+                       String url = urls[0];
+                       BufferedReader inStream = null;
+                       try {
+                               HttpClient httpClient = new DefaultHttpClient();
+                               HttpGet httpRequest = new HttpGet(url);
+                               HttpResponse response = httpClient.execute(httpRequest);
+                               inStream = new BufferedReader(
+                                       new InputStreamReader(
+                                               response.getEntity().getContent()));
+
+                               StringBuffer buffer = new StringBuffer("");
+                               String line = "";
+                               String NL = System.getProperty("line.separator");
+                               while ((line = inStream.readLine()) != null) {
+                                       buffer.append(line + NL);
+                               }
+                               inStream.close();
+
+                               result = buffer.toString();                     
+                       } catch (Exception e) {
+                               // TODO Auto-generated catch block
+                               e.printStackTrace();
+                       } finally {
+                               if (inStream != null) {
+                                       try {
+                                               inStream.close();
+                                       } catch (IOException e) {
+                                               e.printStackTrace();
+                                       }
+                               }
+                       }
+                       return result;
+            }
+
+            protected void onPostExecute(String result) {
+                Intent itemCreation = new Intent(alt_this, MainActivity.class);
+                startActivity(itemCreation);
+            }
+       }
+}
index ddd12450385c0c87f55af47d684405ec5a4a2576..309cfa7b47ccfb4f4d8bdf71057af869dc9ccc2d 100644 (file)
@@ -3,82 +3,24 @@ package com.jaiswallab.lab.inventory;
 import java.io.BufferedReader;
 
 import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
-import java.io.InputStream;
 import java.io.InputStreamReader;
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.Calendar;
-import java.util.Scanner;
-
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
 
-import org.apache.http.HttpEntity;
+import java.util.Calendar;
 import org.apache.http.HttpResponse;
-import org.apache.http.client.ClientProtocolException;
 import org.apache.http.client.HttpClient;
-import org.apache.http.client.entity.UrlEncodedFormEntity;
 import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpPost;
 import org.apache.http.impl.client.DefaultHttpClient;
-import org.apache.http.util.EncodingUtils;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
-
-import com.google.zxing.*;
-import com.google.zxing.qrcode.QRCodeWriter;
-import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
-import com.google.zxing.qrcode.encoder.ByteMatrix;
-import com.google.zxing.qrcode.encoder.Encoder;
 
 import android.app.Activity;
-import android.content.BroadcastReceiver;
-import android.content.ComponentName;
-import android.content.ContentResolver;
-import android.content.Context;
 import android.content.Intent;
-import android.content.IntentFilter;
-import android.content.IntentSender;
-import android.content.ServiceConnection;
-import android.content.SharedPreferences;
-import android.content.IntentSender.SendIntentException;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.content.res.AssetManager;
-import android.content.res.Configuration;
-import android.content.res.Resources;
-import android.content.res.Resources.Theme;
-import android.database.DatabaseErrorHandler;
-import android.database.sqlite.SQLiteDatabase;
-import android.database.sqlite.SQLiteDatabase.CursorFactory;
 import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.graphics.Color;
-import android.graphics.drawable.Drawable;
-import android.media.MediaScannerConnection;
-import android.media.MediaScannerConnection.MediaScannerConnectionClient;
 import android.net.Uri;
 import android.os.AsyncTask;
 import android.os.Bundle;
-import android.os.Environment;
-import android.os.Handler;
-import android.os.Looper;
-import android.os.UserHandle;
-import android.provider.MediaStore;
-import android.util.Log;
-import android.view.Display;
 import android.view.Menu;
 import android.view.View;
-import android.webkit.WebView;
 import android.widget.EditText;
 
 public class MainActivity extends Activity {
@@ -86,8 +28,8 @@ public class MainActivity extends Activity {
        boolean printingNewQR = false;
        boolean recognizingQR = false;
        private String contents = "";
-       private boolean scanSuccess;
        private String code = "";
+       private boolean scanSuccess;
        private EditText text1;
        private EditText text2;
        private EditText text3;
@@ -120,6 +62,11 @@ public class MainActivity extends Activity {
     public void recognizeQRClick(View view) throws CloneNotSupportedException { 
        printingNewQR = false;
        recognizingQR = true;
+       text1.setText("");
+       text2.setText("");
+       text3.setText("");
+       text4.setText("");
+       text5.setText("");
        
        IntentIntegrator intentIntegrator = new IntentIntegrator(this);
        intentIntegrator.initiateScan();
@@ -133,6 +80,11 @@ public class MainActivity extends Activity {
                 }
     }
     
+    public void newItemClick(View view) {
+        Intent itemCreation = new Intent(MainActivity.this, ItemCreationActivity.class);
+        startActivity(itemCreation);
+    }
+    
     public void updateInventoryItem(View view) {
        if(scanSuccess) {
                String params = "";
@@ -164,7 +116,7 @@ public class MainActivity extends Activity {
        case IntentIntegrator.REQUEST_CODE:
                IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
                if (scanResult != null) {
-                       String contents = scanResult.getContents();
+                       contents = scanResult.getContents();
                        if(recognizingQR){
                                scanSuccess = false;
                                recognizingQR = false;
@@ -180,46 +132,9 @@ public class MainActivity extends Activity {
     //this will use the information passed to it to reference an existing ID in the database
     //it will display the database information in a useful format
     public void displayQRInfo(String id) {
-        httpGet(id);
+       httpGet(id);
        return;
     }
-    
-       public String savePhoto(Bitmap bmp) throws Exception {
-               File root = android.os.Environment.getExternalStorageDirectory();
-           File dir = new File (root.getAbsolutePath() + "/Pictures");
-           
-           FileOutputStream out = null;
-               Calendar c = Calendar.getInstance();
-               String date = fromInt(c.get(Calendar.MONTH))
-                               + fromInt(c.get(Calendar.DAY_OF_MONTH))
-                               + fromInt(c.get(Calendar.YEAR))
-                               + fromInt(c.get(Calendar.HOUR_OF_DAY))
-                               + fromInt(c.get(Calendar.MINUTE))
-                               + fromInt(c.get(Calendar.SECOND));
-               text2.setText(date);
-               File imageFileName = new File(dir, date.toString() + ".jpg");
-               if(imageFileName!=null) text4.setText("file seems to be created");
-               try {
-                       out = new FileOutputStream(imageFileName);
-                       if (bmp.compress(Bitmap.CompressFormat.JPEG, 100, out)) text1.setText("bitmap successfully compressed");
-                       try {
-                               out.flush();
-                       } catch (IOException e) {
-                               e.printStackTrace();
-                       }
-                       try {
-                               out.close();
-                       } catch (IOException e) {
-                               e.printStackTrace();
-                       }
-                       text4.setText(imageFileName.toString());
-                       out = null;
-               } catch (Exception e) {
-                       System.out.println("unable to save photo");
-                       e.printStackTrace();
-               }
-               return imageFileName.toString();
-       }
 
        public String fromInt(int val) {
                return String.valueOf(val);
@@ -237,7 +152,7 @@ public class MainActivity extends Activity {
        
        private class HttpGetTask extends AsyncTask<String, Integer, String> {
                String result = "Failed: Invalid QR Code";
-           
+               
             protected String doInBackground(String... urls) {
                        String url = urls[0];
                        BufferedReader inStream = null;