Hello friends i want to set notification with two specific dates like
date1= 2014/10/30
date2=2015/10/30
and alarm should be notify at every 5th day(means date=5) of every month until date2.
how can i achieve this any idea Thanks in advances?
Related
First I have to convert the integer to time (which I've managed to do so far) and then I want to schedule a notification on that time. You see that checkbox, When someone taps then alarm is set. So I don't multiple alarms. And most importantly I can't flutter default time picker (That works) but I can't use since I'm setting the alarm with my default time picker.
Now I want to take that value and convert that to time and set a notification on that time.
Thanks everyone in advance Alarm App Screen
I've tried flutter_local_notifications package but I can't seem to figure out how can I take the integer value and set it to schedule notification.
If I understand you correctly you mean you want to convert int to a DateTime and use it to schedule notifications.
to convert int to DateTime you can specify the current date and specify the hour and minute.
final now= DateTime.now();
DateTime(now.year,now.month,now.day,pm ? 12+ hour: hour, minute );
pm will be a bool that can be toogled by the user, so if the user picks 1pm the hr will be 13 since the hr has to be in 24hr format.
so after getting the dateTime use link to schedule notification with flutterLocalNotifications
I have trouble implementing Reminder for my app.i did research but couldnt find proper solution.
what i want is:
i am developing an android app which has one feature to remind users about the selected event 30 min before event start.
i will be displaying the date and time of the event in textview,on click of reminder button reminder will set 30min before event.
how can i proceed to implement this.
Note: i dont want to use date/time picker, specific date and time will be taken directly from text view which i will display.
Any suggestion/links with logic please help.
if any one can help dn please tell me the logic to add future,date + hours + minutes to current time to set alarm(date and time will be taken from textview)
I am taking two dates from the user in my android code. I want to set reminder for every month which are in between those two dates.
If first date is : 1st jan 2015 and other date is 1st Feb 2016 then I want to set reminder for the 1st day every month in between these two dates. I tried using alarm manager but couldnt able to repeat alarm. Please help. thank you
One method might be to have your alarm receiver set the next alarm when it is called (e.g. it activates on 1 Jan 2015 and sets the next one for 1 Feb 2015), so you're always setting one ahead.
First you'll need to create 2 Calendar objects to store the dates to store the dates set by the user. Then proceed by either creating pending intents for each date in a for loop by incrementing the value of month. Assign all the pending intents to your AlarmManager and fire them with FLAG_ONE_SHOT.
Please provide your code so we could better understand your problem.
I want to add three different type reminder for a single event.
Example: For a event I want to add a reminder 1 week before the event deadline and another two reminders 1 day and 1 hour before respectively.
I managed to set the reminders for a single event, but I am facing a problem in setting proper time format in reminder menu.
The reminder time shows when the particular event is pressed from the native calender it shows two consecutive 4 or 5 digit no. in the reminder list., not in the proper day or week format.
To add a reminder I am Using Reminder.MINUTES .
Is it possible to add a reminder in day or week format except minute format?
Try with this
DateFormat dateFormat = dateFormat.format(new Date(yourTime));
I have tried to do this without bothering the experts and have read numerous threads here and on other sites. It is clearly my brain not understanding what needs to be done in order for this to work.
My goal is that the app allows the user to enter a time and one or more days in a week. All of the GUI side and storing of the dates and times I have done, however to get the alarm manager to repeat, lets say every Monday at 14:00 and then can send at 14:02 . I have used the java Calendar object to hold the times and days of the week or even used date and day of the week of the month. These are then , as needed, converted to milliseconds for it to be read in by the alarm manager.
I then have used either the alarm manager set or set repeat methods to repeat the event. All I am able to do is get it to occur once and then if I change the emulator date and time to another Monday nothing happens.
The GUI holds the hours and minutes in required variables and then these are used against the calendar objects.
The alarm manager calls a broadcast receiver for the event to occur.
Please can someone simply give an example on how to set specific days such as Monday , Wednesday Friday. I know that separate alarm managers are needed for each day and at the moment I have just focused on Monday as my main test.
Links viewed:
How can i Repeat the Alarm in android for only Monday, Tuesday and Friday
How to repeat the alarm for "n" days at a particular time
how to repeat alarm after 1 day in android
Managed to figure this out now and so follows my answer:
The following code calculates the remaining days between now and the day needed for the scheduled task. the variable whichday is passed via parameter from the method this code belongs to. In the understanding of this whichday represents days of the week 1 through to 7 where 1 is Sunday , 2 is Monday and so .
//This gets the current day of the week as of TODAY / NOW
int checkcurrentday = getcurtime.get(Calendar.DAY_OF_WEEK);
// This calculates the days between now and the day needed which is represented by whichday.
int numberofdays = Calendar.SATURDAY + whichday - checkcurrentday;
//Now add NOT set the difference of the days to your Calendar object
tMondayOn.add(Calendar.DATE, numberofdays);
Well, you need to first use the Java Calendar API (or Joda!) to figure out when the next monday is. Set the alarm to to that time in milliseconds then use setRepeating and pass in a long that represents the interval of one week.