]> iEval git - unical.git/commitdiff
Remove database classes, ic_launcher-web and more cleanups
authorMarius Gavrilescu <marius@ieval.ro>
Tue, 11 Jun 2013 10:35:59 +0000 (13:35 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Tue, 11 Jun 2013 10:35:59 +0000 (13:35 +0300)
.classpath
ic_launcher-web.png [deleted file]
src/ro/ieval/unical/DatabaseInteract.java [deleted file]
src/ro/ieval/unical/DeleteEventDialog.java
src/ro/ieval/unical/EventAdapter.java
src/ro/ieval/unical/MySQLiteHelper.java [deleted file]

index a900c9893c13f7d1f0306897e8df37374f76fedc..538127472825ab975c75140f2142e2dd15e0862a 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-       <classpathentry excluding="ro/ieval/unical/DatabaseInteract.java|ro/ieval/unical/MySQLiteHelper.java" kind="src" path="src"/>
+       <classpathentry kind="src" path="src"/>
        <classpathentry kind="src" path="gen"/>
        <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
        <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
diff --git a/ic_launcher-web.png b/ic_launcher-web.png
deleted file mode 100644 (file)
index a256e1c..0000000
Binary files a/ic_launcher-web.png and /dev/null differ
diff --git a/src/ro/ieval/unical/DatabaseInteract.java b/src/ro/ieval/unical/DatabaseInteract.java
deleted file mode 100644 (file)
index 520eba8..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-package ro.ieval.unical;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import android.content.ContentValues;
-import android.content.Context;
-import android.database.Cursor;
-import android.database.SQLException;
-import android.database.sqlite.SQLiteDatabase;
-
-public class DatabaseInteract {
-       private SQLiteDatabase database;
-       private MySQLiteHelper dbHelper;
-       private String[] allColumns = {
-                       MySQLiteHelper.ID, MySQLiteHelper.title, 
-                       MySQLiteHelper.description, MySQLiteHelper.date,
-                       MySQLiteHelper.duration, MySQLiteHelper.repeat,
-                       MySQLiteHelper.repeatIn, MySQLiteHelper.location
-       };
-       
-       public DatabaseInteract(Context context) {
-               dbHelper = new MySQLiteHelper(context);
-               database=dbHelper.getWritableDatabase();
-       }
-       
-       public void open() throws SQLException {
-               database=dbHelper.getWritableDatabase();
-       }
-       
-       public void close() {
-               dbHelper.close();
-       }
-       
-       //Insert event
-       public void insertEvent(Event e) {
-               ContentValues values = new ContentValues();
-               values.put(allColumns[0], e._id);
-               values.put(allColumns[1], e.title);
-               values.put(allColumns[2], e.description);
-               values.put(allColumns[3], e.date);
-               values.put(allColumns[4], e.duration);
-               values.put(allColumns[5], e.repeat);
-               values.put(allColumns[6], e.repeatInterval);
-               values.put(allColumns[7], e.location);
-               database.insert(MySQLiteHelper.Name, null, values);
-       }
-       //Delete event
-       public void deleteEvent(String id) {
-               database.delete(MySQLiteHelper.Name, MySQLiteHelper.ID + "=" + id, null);
-       }
-       //Search event
-       //Get all events
-       public List<Event> getAllEvents() {
-               List<Event> events=new ArrayList<Event>();
-               Cursor cursor=database.query(MySQLiteHelper.Name,allColumns,null,null,null,null,null);
-               
-               for(cursor.moveToFirst();!cursor.isAfterLast();cursor.moveToNext()) {
-                       Event ev=cursorToEvent(cursor);
-                       events.add(ev);
-               }
-               return events;
-       }
-
-       private Event cursorToEvent(Cursor cursor) {
-               // TODO Auto-generated method stub
-               Event e = new Event();
-               e._id=cursor.getString(0);
-               e.title=cursor.getString(1);
-               e.description=cursor.getString(2);
-               e.date=cursor.getInt(3);
-               e.duration=cursor.getInt(4);
-               if(cursor.getInt(5)==1) e.repeat=true;
-               else e.repeat=false;
-               e.repeatInterval=cursor.getInt(6);
-               e.location=cursor.getString(7);
-               return e;
-       }
-}
index 8dc2267e43626d8fe11fda4e7f68c7a1b98a2612..40fe58251af3382842b1c51c94e51020d33ced62 100644 (file)
@@ -14,7 +14,7 @@ public final class DeleteEventDialog extends DialogFragment {
                           .setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
                                   @Override
                                   public void onClick(final DialogInterface dialog, final int id) {
-
+                                          // Nothing happens here yet
                                   }
                           })
                           .setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
index 7aa48338c6e01db21d9369210284d3c3e0edbae8..577ea0c1e4f9a3abb71332aeb86fa67f4e6fa432 100644 (file)
@@ -13,7 +13,7 @@ public class EventAdapter extends ArrayAdapter<Event> {
        private final Event[] values;
        private final Context context;
 
-       public EventAdapter(final Context context, final Event[] values) {
+       public EventAdapter(final Context context, final Event[] values) {//NOPMD
                super(context,R.layout.event_row_layout,values);
                this.context=context;
                this.values=values;
diff --git a/src/ro/ieval/unical/MySQLiteHelper.java b/src/ro/ieval/unical/MySQLiteHelper.java
deleted file mode 100644 (file)
index dbadca5..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-package ro.ieval.unical;
-
-import android.content.Context;
-import android.database.sqlite.SQLiteDatabase;
-import android.database.sqlite.SQLiteOpenHelper;
-import android.util.Log;
-
-public class MySQLiteHelper extends SQLiteOpenHelper {
-       public static final String Name="Events";
-       
-       public static final String ID = "_id";
-       public static final String title = "Title";
-       public static final String description = "Description";
-       public static final String date = "Date";
-       public static final String duration = "Duration";
-       public static final String repeat = "repeat";
-       public static final String repeatIn = "repeatInterval";
-       public static final String location = "Location";
-       
-       private static final int dbversion=1;
-       
-       private static final String Database_create = "create table " + Name + "(" + 
-                       //ID + " integer primary key autoincrement, " +
-                       ID + " text primary key, " +
-                       title + " text not null, " + 
-                       description + " text, " + 
-                       date + " integer, " + 
-                       duration + " integer, " +
-                       repeat + " integer, "+
-                       repeatIn + " integer, " +
-                       location + " text);"
-                       ;
-       
-       public MySQLiteHelper(Context context) {
-               super(context,Name, null, dbversion);
-               // TODO Auto-generated constructor stub
-       }
-
-       @Override
-       public void onCreate(SQLiteDatabase db) {
-               // TODO Auto-generated method stub
-               db.execSQL(Database_create);
-               
-       }
-
-       @Override
-       public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
-               // TODO Auto-generated method stub
-               Log.w(MySQLiteHelper.class.getName(),
-                               "Upgrading database from version " + oldVersion + " to "
-                                       + newVersion + ", which will destroy all old data");
-                       db.execSQL("DROP TABLE IF EXISTS " + Name);
-                       onCreate(db);
-       }
-       
-}
\ No newline at end of file
This page took 0.0327 seconds and 4 git commands to generate.