Rensselaer Center for Open Source Software

Added video tagging functionality and a menu displaying recorded events

32 files changed, 117 lines added, 23 lines removed

Changes

--- Chronicle_Android/Chronicle/bin/Chronicle.apk 7f020da75286bb436464a95770c1744b50f1f9ad
+++ Chronicle_Android/Chronicle/bin/Chronicle.apk e66b49adb8071ba37577afd952407ca7cd15ccf2
@@ -1,13 +1,14 @@
+%
@@ -15,7 +16,7 @@
@@ -26,14 +27,14 @@
@@ -71,7 +72,7 @@
@@ -102,7 +103,7 @@
@@ -139,9 +140,9 @@
@@ -157,7 +158,7 @@
@@ -172,76 +173,102 @@
+
--- Chronicle_Android/Chronicle/bin/chronicle/client/ChronicleActivity$1.class 7f020da75286bb436464a95770c1744b50f1f9ad
+++ Chronicle_Android/Chronicle/bin/chronicle/client/ChronicleActivity$1.class e66b49adb8071ba37577afd952407ca7cd15ccf2
@@ -6,6 +6,6 @@
--- Chronicle_Android/Chronicle/bin/chronicle/client/ChronicleActivity$2.class 7f020da75286bb436464a95770c1744b50f1f9ad
+++ Chronicle_Android/Chronicle/bin/chronicle/client/ChronicleActivity$2.class e66b49adb8071ba37577afd952407ca7cd15ccf2
@@ -1,21 +1,26 @@
--- Chronicle_Android/Chronicle/bin/chronicle/client/ChronicleActivity$3$1.class 7f020da75286bb436464a95770c1744b50f1f9ad
+++ Chronicle_Android/Chronicle/bin/chronicle/client/ChronicleActivity$3$1.class e66b49adb8071ba37577afd952407ca7cd15ccf2
@@ -1,0 +1,22 @@
+
--- Chronicle_Android/Chronicle/bin/chronicle/client/ChronicleActivity$3$2.class 7f020da75286bb436464a95770c1744b50f1f9ad
+++ Chronicle_Android/Chronicle/bin/chronicle/client/ChronicleActivity$3$2.class e66b49adb8071ba37577afd952407ca7cd15ccf2
@@ -1,0 +1,8 @@
--- Chronicle_Android/Chronicle/bin/chronicle/client/ChronicleActivity$3.class 7f020da75286bb436464a95770c1744b50f1f9ad
+++ Chronicle_Android/Chronicle/bin/chronicle/client/ChronicleActivity$3.class e66b49adb8071ba37577afd952407ca7cd15ccf2
@@ -1,9 +1,17 @@
--- Chronicle_Android/Chronicle/bin/chronicle/client/ChronicleActivity$4.class 7f020da75286bb436464a95770c1744b50f1f9ad
+++ Chronicle_Android/Chronicle/bin/chronicle/client/ChronicleActivity$4.class e66b49adb8071ba37577afd952407ca7cd15ccf2
@@ -1,18 +1,19 @@
--- Chronicle_Android/Chronicle/bin/chronicle/client/ChronicleActivity$5$1.class 7f020da75286bb436464a95770c1744b50f1f9ad
+++ Chronicle_Android/Chronicle/bin/chronicle/client/ChronicleActivity$5$1.class e66b49adb8071ba37577afd952407ca7cd15ccf2
@@ -1,0 +1,18 @@
--- Chronicle_Android/Chronicle/bin/chronicle/client/ChronicleActivity$5$2.class 7f020da75286bb436464a95770c1744b50f1f9ad
+++ Chronicle_Android/Chronicle/bin/chronicle/client/ChronicleActivity$5$2.class e66b49adb8071ba37577afd952407ca7cd15ccf2
@@ -1,0 +1,8 @@
--- Chronicle_Android/Chronicle/bin/chronicle/client/ChronicleActivity$5.class 7f020da75286bb436464a95770c1744b50f1f9ad
+++ Chronicle_Android/Chronicle/bin/chronicle/client/ChronicleActivity$5.class e66b49adb8071ba37577afd952407ca7cd15ccf2
@@ -1,9 +1,22 @@
--- Chronicle_Android/Chronicle/bin/chronicle/client/ChronicleActivity$6.class 7f020da75286bb436464a95770c1744b50f1f9ad
+++ Chronicle_Android/Chronicle/bin/chronicle/client/ChronicleActivity$6.class e66b49adb8071ba37577afd952407ca7cd15ccf2
@@ -1,15 +1,13 @@
--- Chronicle_Android/Chronicle/bin/chronicle/client/ChronicleActivity.class 7f020da75286bb436464a95770c1744b50f1f9ad
+++ Chronicle_Android/Chronicle/bin/chronicle/client/ChronicleActivity.class e66b49adb8071ba37577afd952407ca7cd15ccf2
@@ -1,107 +1,122 @@
-
--- Chronicle_Android/Chronicle/bin/classes.dex 7f020da75286bb436464a95770c1744b50f1f9ad
+++ Chronicle_Android/Chronicle/bin/classes.dex e66b49adb8071ba37577afd952407ca7cd15ccf2
@@ -1,74 +1,126 @@
-
--- Chronicle_Android/Chronicle/bin/resources.ap_ 7f020da75286bb436464a95770c1744b50f1f9ad
+++ Chronicle_Android/Chronicle/bin/resources.ap_ e66b49adb8071ba37577afd952407ca7cd15ccf2
@@ -1,20 +1,21 @@
+%
@@ -24,13 +25,13 @@
@@ -67,7 +68,7 @@
@@ -97,7 +98,7 @@
@@ -134,8 +135,8 @@
@@ -150,7 +151,7 @@
@@ -165,5 +166,5 @@
--- Chronicle_Android/Chronicle/res/layout/main.xml 7f020da75286bb436464a95770c1744b50f1f9ad
+++ Chronicle_Android/Chronicle/res/layout/main.xml e66b49adb8071ba37577afd952407ca7cd15ccf2
@@ -11,8 +11,7 @@
-      <ExpandableListView android:id="@+id/savedFiles" android:layout_width="match_parent" android:layout_height="423dp"></ExpandableListView>
+      <ListView android:id="@+id/savedFiles" android:layout_width="match_parent" android:layout_height="423dp"></ListView>
-//FIGURE OUT HOW TO NEST ANOTHER FRAMELAYOUT HERE AS CAMERA_PREVIEW2
--- Chronicle_Android/Chronicle/src/chronicle/client/ChronicleActivity.java 7f020da75286bb436464a95770c1744b50f1f9ad
+++ Chronicle_Android/Chronicle/src/chronicle/client/ChronicleActivity.java e66b49adb8071ba37577afd952407ca7cd15ccf2
@@ -16,11 +16,16 @@
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.List;
+import android.database.Cursor;
+import android.database.sqlite.SQLiteDatabase;
@@ -45,24 +50,31 @@
+import android.widget.ArrayAdapter;
+import android.widget.EditText;
+import android.widget.ExpandableListView;
+import android.widget.ListView;
+  SQLiteDatabase fileDataBase;
+  int startTime;
+  ListView filesList;
@@ -78,13 +90,17 @@
+    
+    
-
-    Button button = (Button) findViewById(R.id.recordButton);
+    filesList = (ListView) findViewById(R.id.savedFiles);
+    this.fileDataBase = this.openOrCreateDatabase("fileDB", MODE_PRIVATE, null);
+      this.fileDataBase.execSQL("CREATE TABLE IF NOT EXISTS table_of_dics(value TEXT)");
+    this.update_list();
+      Button button = (Button) findViewById(R.id.recordButton);
-        // Perform action on click
@@ -106,15 +122,23 @@
+    
+        mCamera.stopPreview();
+
+
+          Calendar c = Calendar.getInstance(); 
+          startTime = c.get(Calendar.HOUR)*3600 + c.get(Calendar.MINUTE)*60 + c.get(Calendar.SECOND);
+          Toast.makeText(getApplicationContext(), "RECORDING2", Toast.LENGTH_SHORT).show();
+
@@ -126,7 +150,28 @@
-        dialog.cancel();
+        AlertDialog.Builder tagAlert = new AlertDialog.Builder(ChronicleActivity.this);
+        tagAlert.setTitle("Leave a tag");
+        //tagAlert.setMessage("Message");
+        // Set an EditText view to get user input 
+        final EditText input = new EditText(ChronicleActivity.this);
+        tagAlert.setView(input);
+        tagAlert.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
+          public void onClick(DialogInterface dialog, int whichButton) {
+            String value = input.getText().toString();
+            Calendar c = Calendar.getInstance(); 
+            int currentTime = c.get(Calendar.HOUR)*3600 + c.get(Calendar.MINUTE)*60 + c.get(Calendar.SECOND);;
+            tags=tags+value+":::"+"0000000000"+";;;";
+          }
+        });
+        tagAlert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
+          public void onClick(DialogInterface dialog, int whichButton) {
+            // Canceled.
+          }
+        });
+        tagAlert.show();
+        //tags=tags+"TESTING SAVING A TAG";
+        //dialog.cancel();
@@ -134,7 +179,7 @@
-        //writeTagFile(tags);
+        writeTagFile(tags);
@@ -145,7 +190,28 @@
-        dialog.cancel();
+        AlertDialog.Builder tagAlert = new AlertDialog.Builder(ChronicleActivity.this);
+        tagAlert.setTitle("Leave a tag");
+        Calendar c = Calendar.getInstance(); 
+        final int currentTime = c.get(Calendar.HOUR)*3600 + c.get(Calendar.MINUTE)*60 + c.get(Calendar.SECOND);;
+
+        //tagAlert.setMessage("Message");
+        // Set an EditText view to get user input 
+        final EditText input = new EditText(ChronicleActivity.this);
+        tagAlert.setView(input);
+        tagAlert.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
+          public void onClick(DialogInterface dialog, int whichButton) {
+            String value = input.getText().toString();
+            tags=tags+value+":::"+Integer.toString(currentTime-startTime)+";;;";
+          }
+        });
+        tagAlert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
+          public void onClick(DialogInterface dialog, int whichButton) {
+            // Canceled.
+          }
+        });
+        tagAlert.show();
+        //dialog.cancel();
@@ -160,31 +226,28 @@
-    //       PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
-    //     final PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "My Tag");
-              registerForContextMenu(v);
-              //mCamera.stopPreview();builder = new AlertDialog.Builder(this);
-              
-
+              //registerForContextMenu(v);
+              //mCamera.stopPreview();
-                builderStop.create();
-                builderStop.create();
+                //builderStop.create();
+                builderStop.show();
-                builderStart.create();
+                //builderStart.create();
-            return false;
+            return true;
+    
@@ -201,6 +264,23 @@
+  private void update_list() {
+    //fileDataBase.execSQL("INSERT INTO table_of_dics(value) VALUES('TEST')");
+    //fileDataBase.execSQL("INSERT INTO table_of_dics(value) VALUES('TEST3')");
+    //fileDataBase.execSQL("INSERT INTO table_of_dics(value) VALUES('TES2T')");
+
+    
+    ArrayList<String> db_results = new ArrayList<String>();
+    Cursor cursor = fileDataBase.rawQuery("SELECT value FROM table_of_dics ORDER BY value", null);
+    while(cursor.moveToNext()) {
+      db_results.add(String.valueOf(cursor.getString(cursor.getColumnIndex("value"))));
+      //db_results.add(cursor.getColumnIndex("value"));
+      //db_results.add("TEST");
+    }
+    cursor.close();
+    this.filesList.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, db_results));
+  }
+
@@ -220,7 +300,7 @@
-    String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()); 
+    timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()); 
@@ -280,9 +360,22 @@
-      FileWriter tagFile = new FileWriter(Environment.getExternalStorageDirectory()+"/recordedMedia/"+timeStamp+".txt");
-      tagFile.write(tags);
+      Log.d("WRITETAG", "Attempting to write to tag file "+tags);
+      
+
+        File tagFile = new File(Environment.getExternalStorageDirectory()+"/recordedMedia/"+timeStamp+".txt");
+      FileWriter tagWriter = new FileWriter(tagFile);
+        //FileWriter tagFile = new FileWriter(Environment.getExternalStorageDirectory()+"/recordedMedia/"+timeStamp+".txt");
+      tagWriter.write(tags);
+      tagWriter.write(";IS THIS WRITING?");
+      tagWriter.flush();
+      tagWriter.close();
+      Log.d("WRITETAG", "Supposedly successful write to tag file");
+      fileDataBase.execSQL("INSERT INTO table_of_dics(value) VALUES('"+timeStamp+"')");
+
+      Log.d("WRITETAG", "IOException writing to tag file: " + e1.getMessage());
+
Chronicle • 57 weeks ago