diff --git a/SE4351_class_project-master/MedMemory/AndroidManifest.xml b/SE4351_class_project-master/MedMemory/AndroidManifest.xml
index 0e48b8c..af49642 100644
--- a/SE4351_class_project-master/MedMemory/AndroidManifest.xml
+++ b/SE4351_class_project-master/MedMemory/AndroidManifest.xml
@@ -11,7 +11,7 @@
+ android:parentActivityName=".Appointments">
diff --git a/SE4351_class_project-master/MedMemory/project.properties b/SE4351_class_project-master/MedMemory/project.properties
index 0c9830a..6e18427 100644
--- a/SE4351_class_project-master/MedMemory/project.properties
+++ b/SE4351_class_project-master/MedMemory/project.properties
@@ -11,4 +11,4 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
-target=Google Inc.:Google APIs:17
+target=android-21
diff --git a/SE4351_class_project-master/MedMemory/res/layout/appointments.xml b/SE4351_class_project-master/MedMemory/res/layout/appointments.xml
new file mode 100644
index 0000000..744f90a
--- /dev/null
+++ b/SE4351_class_project-master/MedMemory/res/layout/appointments.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SE4351_class_project-master/MedMemory/res/layout/calendar.xml b/SE4351_class_project-master/MedMemory/res/layout/calendar.xml
deleted file mode 100644
index a58e0ce..0000000
--- a/SE4351_class_project-master/MedMemory/res/layout/calendar.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/SE4351_class_project-master/MedMemory/res/layout/eventcreation.xml b/SE4351_class_project-master/MedMemory/res/layout/eventcreation.xml
new file mode 100644
index 0000000..bd0734d
--- /dev/null
+++ b/SE4351_class_project-master/MedMemory/res/layout/eventcreation.xml
@@ -0,0 +1,137 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SE4351_class_project-master/MedMemory/src/com/example/memorymed/AlarmManager.java b/SE4351_class_project-master/MedMemory/src/com/example/memorymed/AlarmManager.java
new file mode 100644
index 0000000..f3a3799
--- /dev/null
+++ b/SE4351_class_project-master/MedMemory/src/com/example/memorymed/AlarmManager.java
@@ -0,0 +1,132 @@
+package com.example.memorymed;
+
+import java.util.Iterator;
+import java.util.TreeMap;
+
+import android.os.Bundle;
+
+
+//Simplified storage for events
+public abstract class AlarmManager
+{
+ private static TreeMap events = new TreeMap();
+
+ public static void addEvent(String name, Event e)
+ {
+ events.put(name, e);
+ }
+
+ public static Event getEvent(String name)
+ {
+ return events.get(name);
+ }
+
+ public static Event removeEvent(String name)
+ {
+ return events.remove(name);
+ }
+
+ public static boolean removeEvent(Event e)
+ {
+ Iterator it = events.values().iterator();
+ while(it.hasNext())
+ {
+ Event e2 = it.next();
+ if(e.equals(e2))
+ {
+ it.remove();
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static boolean containsEvent(Event e)
+ {
+ return events.containsValue(e);
+ }
+
+ public static boolean containsName(String name)
+ {
+ return events.containsKey(name);
+ }
+
+ public static int getSize()
+ {
+ return events.size();
+ }
+
+
+
+ //A basic wrapper for the event information
+ private final class Event
+ {
+ private Bundle information;
+ public static final String
+ REPEAT = "repeat",
+ BEGIN_TIME = "begintime",
+ END_TIME = "endtime",
+ TITLE = "title",
+ CONTENT = "content";
+
+ public static final int
+ WEEKLY = 0xF001,
+ BIWEEKLY = 0xF002,
+ MONTHLY = 0xF003,
+ YEARLY = 0xF004;
+
+ public Event()
+ {
+ information = new Bundle();
+ }
+
+
+ /*
+ * Makes sure the Bundle only has specific entries related to information
+ * needed for an event (i.e. date, start time, etc.). Returns true if the
+ * extra was added successfully.
+ */
+ public boolean putExtra(String key, Object value)
+ {
+ if(key.equals(REPEAT) && value instanceof Integer)
+ {
+ Integer v = (Integer) value;
+ switch(v)
+ {
+ case WEEKLY: case BIWEEKLY: case MONTHLY: case YEARLY: information.putInt(key, v); return true;
+ }
+ }
+ else if(key.equals(BEGIN_TIME) && value instanceof java.util.Calendar)
+ {
+ java.util.Calendar v = (java.util.Calendar) value;
+ information.putSerializable(key, v);
+ return true;
+ }
+ else if(key.equals(END_TIME) && value instanceof java.util.Calendar)
+ {
+ java.util.Calendar v = (java.util.Calendar) value;
+ information.putSerializable(key, v);
+ return true;
+ }
+ else if(key.equals(TITLE) && value instanceof String)
+ {
+ String v = (String) value;
+ information.putString(key, v);
+ return true;
+ }
+ else if(key.equals(CONTENT) && value instanceof String)
+ {
+ String v = (String) value;
+ information.putString(key, v);
+ return true;
+ }
+
+ return false;
+ }
+
+ public Object getValue(String key)
+ {
+ return information.get(key);
+ }
+ }
+}
diff --git a/SE4351_class_project-master/MedMemory/src/com/example/memorymed/Calendar.java b/SE4351_class_project-master/MedMemory/src/com/example/memorymed/Appointments.java
similarity index 82%
rename from SE4351_class_project-master/MedMemory/src/com/example/memorymed/Calendar.java
rename to SE4351_class_project-master/MedMemory/src/com/example/memorymed/Appointments.java
index 9cfce04..25033d1 100644
--- a/SE4351_class_project-master/MedMemory/src/com/example/memorymed/Calendar.java
+++ b/SE4351_class_project-master/MedMemory/src/com/example/memorymed/Appointments.java
@@ -6,16 +6,19 @@
import android.os.Bundle;
import android.util.Log;
-public class Calendar extends Activity
+public class Appointments extends Activity
{
- private String calendar;
+ //private String calendar;
+
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
- setContentView(R.layout.calendar);
+ setContentView(R.layout.appointments);
+
+
- boolean firstTime = this.getIntent().getExtras().getBoolean("isFirstTime");
+ /*boolean firstTime = this.getIntent().getExtras().getBoolean("isFirstTime");
if(firstTime)
{
@@ -26,6 +29,7 @@ protected void onCreate(Bundle savedInstanceState)
* Will read in settings asynchronous to first time dialog. Thus, reads in
* settings if it's not the first time, or sets defaults if it is.
*/
+ /*
SharedPreferences settings = getSharedPreferences(MainActivity.PREF_NAME, 0);
calendar = settings.getString("selectedCalendar", "None");
@@ -33,12 +37,14 @@ protected void onCreate(Bundle savedInstanceState)
if(!calendar.equals("None"))
{
- }
+ }*/
}
/*
* Prompts the user for their choice of calendar, or use app's local calendar
*/
+
+ /*
private void promptCalendarChoice() {
CalendarSelectionDialog dialog = new CalendarSelectionDialog();
dialog.setCancelable(false);
@@ -57,8 +63,11 @@ public void setCalendar(String calendar)
/*
* This refresh the list of events. Called during onCreate and whenever the user edits, adds, or deletes events.
*/
+
+ /*
private void populateEvents()
{
}
+ */
}
diff --git a/SE4351_class_project-master/MedMemory/src/com/example/memorymed/CalendarSelectionDialog.java b/SE4351_class_project-master/MedMemory/src/com/example/memorymed/CalendarSelectionDialog.java
index 770f9af..d83d69f 100644
--- a/SE4351_class_project-master/MedMemory/src/com/example/memorymed/CalendarSelectionDialog.java
+++ b/SE4351_class_project-master/MedMemory/src/com/example/memorymed/CalendarSelectionDialog.java
@@ -21,15 +21,15 @@ public Dialog onCreateDialog(Bundle savedInstanceState)
@Override
public void onClick(DialogInterface dialog, int which)
{
- Calendar calendar;
+ Appointments calendar;
SharedPreferences settings = getActivity().getSharedPreferences(MainActivity.PREF_NAME, 0);
SharedPreferences.Editor editor = settings.edit();
editor.putString("", calendars[which]);
editor.commit();
try
{
- calendar = (Calendar) getActivity();
- calendar.setCalendar(calendars[which]);
+ calendar = (Appointments) getActivity();
+ //calendar.setCalendar(calendars[which]);
}
catch(ClassCastException e)
{
diff --git a/SE4351_class_project-master/MedMemory/src/com/example/memorymed/MainActivity.java b/SE4351_class_project-master/MedMemory/src/com/example/memorymed/MainActivity.java
index 1f2e7d8..0aa2d0a 100644
--- a/SE4351_class_project-master/MedMemory/src/com/example/memorymed/MainActivity.java
+++ b/SE4351_class_project-master/MedMemory/src/com/example/memorymed/MainActivity.java
@@ -64,8 +64,8 @@ public boolean onOptionsItemSelected(MenuItem item) {
return super.onOptionsItemSelected(item);
}
- public void gotocal(View view) {
- Intent myintent = new Intent(this, Calendar.class);
+ public void gotoappointments(View view) {
+ Intent myintent = new Intent(this, Appointments.class);
myintent.putExtra("isFirstTime", isFirstTime);
startActivity(myintent);
}