I am developing a project in Android and I would like to do the following: at a time determined by the user, like 15:40 for example, I would call a function to change the cellphone to silent mode. How can I set it so this function would be called only in this determined time?
Use AlarmManager
to trigger a WakefulBroadcastReceiver
that can either do your work directly (if it is cheap) or delegate the work to an IntentService
(if the work is expensive). The "function" would go in the receiver or the service.