]> matita.cs.unibo.it Git - logicplayer.git/blobdiff - mainActivity/app/src/main/java/com/example/furt/myapplication/personalTrackerContract.java
Ported to latest version of Android SDK
[logicplayer.git] / mainActivity / app / src / main / java / com / example / furt / myapplication / personalTrackerContract.java
diff --git a/mainActivity/app/src/main/java/com/example/furt/myapplication/personalTrackerContract.java b/mainActivity/app/src/main/java/com/example/furt/myapplication/personalTrackerContract.java
new file mode 100644 (file)
index 0000000..2b2d87e
--- /dev/null
@@ -0,0 +1,46 @@
+package com.example.furt.myapplication;
+
+import android.provider.BaseColumns;
+
+
+public final class personalTrackerContract {
+    // To prevent someone from accidentally instantiating the contract class,
+    // give it an empty constructor.
+    public personalTrackerContract() {
+    }
+
+    public static final int DATABASE_VERSION = 1;
+    public static final String DATABASE_NAME = "exercise.db";
+
+    private static final String TEXT_TYPE = " TEXT";
+    private static final String VALUE_TYPE=" DECIMAL";
+    private static final String COMMA_SEP = ",";
+    private static final String INT_TYPE = " INTEGER";
+    private static final String DOUBLE_TYPE=" DOUBLE";
+
+    /* Inner class that defines the table contents */
+    public static abstract class esercizi implements BaseColumns {
+
+        public static final String TABLE_NAME = " esercizi ";
+        public static final String COLUMN_ESERCIZIO = " esercizio ";
+        public static final String COLUMN_MD5 = " md5 ";
+        public static final String COLUMN_UTENTE = " utente ";
+        public static final String COLUMN_TIME = " time ";
+        public static final String COLUMN_CHECK = " checks ";
+        public static final String COLUMN_CLICK = " click ";
+
+        public static final String SQL_CREATE_ENTRIES =
+                "CREATE TABLE " + TABLE_NAME + " (" +
+                        COLUMN_UTENTE + TEXT_TYPE + COMMA_SEP +
+                        COLUMN_MD5 + TEXT_TYPE + COMMA_SEP +
+                        COLUMN_TIME + DOUBLE_TYPE + COMMA_SEP +
+                        COLUMN_CLICK + INT_TYPE + COMMA_SEP +
+                        COLUMN_ESERCIZIO + TEXT_TYPE + COMMA_SEP +
+                        COLUMN_CHECK + INT_TYPE +
+                        " )";
+
+        public static final String SQL_DELETE_ENTRIES =
+                "DROP TABLE IF EXISTS " + TABLE_NAME;
+
+    }
+}
\ No newline at end of file