I have two times and each day these times are different from the previous day for example reminder1-day1: 5:30 reminder1-day2: 5:35
I'm getting the time from the internet with json objects... what I need is to trigger a notification when the system's clock reaches the reminder's time, what I've already done is an actvity containing an alrm manger that takes the time of this reminder and on broad cast receiver it creates a notification; but this isn't a good solution because I can't do a repeating alarm because each day I have different times... and I can't call the same alarm method on broadcast receiver because I would need to create the whole activity again to take all the variable again because they won't be there anymore...
so is there a way to create a service that will work all the time even when the phone is rebooted it will continue its work and will compare the system's time and the reminder's time and will trigger the notification when the two times are equal or is there another solution? thanks.
Edit
public void scheduleAlarm()
{
Long time=calendar.getTimeInMillis()+5*60*1000;
//other lines to get the real time..
Intent intentAlarm = new Intent(this, TimeAlarm.class);
AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
alarmManager.set(AlarmManager.RTC_WAKEUP,time, PendingIntent.getBroadcast(this,1, intentAlarm, PendingIntent.FLAG_UPDATE_CURRENT));
}