Im looking for the best way to complete a certain task when a certain date is reached. What is the best way to a achieve this?
ie. 1st of each month I run command y
Im looking for the best way to complete a certain task when a certain date is reached. What is the best way to a achieve this?
ie. 1st of each month I run command y
Use AlarmManager. You'll also need a BroadcastReceiver for the BOOT_COMPLETED message so you can restart the alarm if the phone is rebooted. TO calculate when the 1st day of the next month is, use the Calendar class- get the Calendar for now, then add 1 to the month and set the day to 1. Then you can convert that to ms for the alarm.