如何构建静默 phone 应用程序?

How to build a silent phone app?

我正在构建一个 android 应用程序,它可以帮助用户指定应用程序将 phone 置于静音模式的时间范围。已经可以实现时间选择器,将时间保存到数据库了

现在,我只需要有人为我指明正确的方向。我正在考虑使用警报管理器 class,但我不知道这是否是我应该使用的方法。

Alarm Manager 是再次触发您的应用 activity 并执行必要工作的正确方法。

来自参考:

These allow you to schedule your application to be run at some point in the future. When an alarm goes off, the Intent that had been registered for it is broadcast by the system, automatically starting the target application if it is not already running

您必须为警报注册一个广播侦听器。在广播监听器中放入您希望您的应用程序执行的所有操作。