From 0fb498a306e41bf560e890c86f335e0b5e5302ce Mon Sep 17 00:00:00 2001 From: bspeice Date: Wed, 9 Oct 2013 20:20:04 -0400 Subject: [PATCH] Add initial code to show alerts --- AndroidManifest.xml | 2 +- bin/AndroidManifest.xml | 2 +- src/com/uncc/gameday/activities/Home.java | 17 ++++++++++++ src/com/uncc/gameday/alerts/Alert.java | 27 +++++++++++++++++++ src/com/uncc/gameday/alerts/AlertDB.java | 5 ++++ src/com/uncc/gameday/alerts/AlertService.java | 13 +++++++++ 6 files changed, 64 insertions(+), 2 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index ab21e06..cd35a53 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -5,7 +5,7 @@ android:versionName="1.0" > alerts) { // Remove multiple dates from the database } + + public List fetchUnread() { + // Fetch all unread alerts + return null; + } } diff --git a/src/com/uncc/gameday/alerts/AlertService.java b/src/com/uncc/gameday/alerts/AlertService.java index b899935..25df483 100644 --- a/src/com/uncc/gameday/alerts/AlertService.java +++ b/src/com/uncc/gameday/alerts/AlertService.java @@ -1,6 +1,11 @@ package com.uncc.gameday.alerts; +import java.util.List; + +import com.uncc.gameday.GameDay; + import android.app.IntentService; +import android.content.Context; import android.content.Intent; public class AlertService extends IntentService { @@ -13,6 +18,14 @@ public class AlertService extends IntentService { @Override protected void onHandleIntent(Intent intent) { // Go fetch all the alerts! + Context appContext = GameDay.getAppContext(); + AlertDB dbHandle = new AlertDB(); + List alerts = dbHandle.fetchUnread(); + + // And then display all of them! + for (Alert a: alerts) { + a.displayNotification(appContext); + } } }