I’m trying to schedule on Android a specific part of my code to be run every week (or every number of days, but set manually…). The thing is: I’ve been looking to the AlarmManager class, but I don’t know if maybe the problem is that I don’t know how to use it or what, but I don’t know how to schedule part of my code to be launched every week.
Any help please?
I’d have a running thread that sleeps for the time that is set manually, remember that this time should be passed as milliseconds.
To model the time, I’d use the Calendar class, because is easier to user the constants it has, like Calendar.DAY_OF_WEEK. Yo can look on how to use this constants for the purpose you have.