To start an android background service when the device boots, you should create a broadcast receiver, and make it listen to android.intent.action.BOOT_COMPLETED action. Then in the custom broadcast receiver’s onReceive method, you can start the background service.
The android alarm is an OS built-in service. It provides timer liked functions. With the android alarm manager, you can create one-time alarms, repeated alarms, and so on. This article will tell you how to use it with examples.