(The implementation tutorial of Android automatic switch, including the author's ideas, implementation process and code details. There are few online introductions, because it requires the support of the underlying RTC clock. At the previous moment, the machine was switched on and off automatically according to customer requirements. Share it here. My implementation is to add an interface in the setup program to let the user set the automatic switch on/off. The setting of the automatic switch on/off can refer to the setting of the alarm clock. As for automatic shutdown, considering that the user may have some important operations during shutdown, the user should be given a chance to cancel the current shutdown. When setting the automatic switch on/off, you need to consider many situations, such as whether to set the time/time zone change, whether the phone is turned on or off at that time.)