The idea behind the Task Reminder application is to remind users through the use of an alarm system that a task must be performed. It will allow users to create a list of time-sensitive tasks, and to set a date and time for the app to remind them of these tasks. To fulfill what is expected of it, the Task Reminder application has a few basic requirements:
For the Task Reminder application to truly work, you need to implement some sort of reminder-based system. As a developer, the first thing that comes to mind is a scheduled task or cron job — methods to handle the scheduled execution of code or scripts in the Windows operating system and the UNIX/Linux operating systems, respectively. Although Android is running the Linux 2.6 kernel, it does not have cron. However, it has the AlarmManager class, which achieves the same thing. The AlarmManager class allows you to specify when your application should start in the future. Alarms can be set as a single-use alarm or as a repeating alarm. You will set the alarm as a single use alarm. This should be perfect for your Task Reminder application.
You are exposed to many new features and tools in this application. You may be wondering where to store the activities, the task data, the alarms, and so on. You can choose from the following locations:
After an alarm fires, you need to notify the user. Although Android provides mechanisms to bring your activity to the foreground when an alarm fires, this is probably not the best approach. Interrupting the user in this way may cause the user to be irritated or confused because an activity started that he did not initiate. However, you can grab the user's attention in other ways, including the following:
The best approach, then, to handle the alarms for the Task Reminder application, is the NotificationManager class.
18.118.0.248