As we know latest API level in android version don't allow long background task in application. So, how can I run my 12 Hours countdown Timer in background because I have to do some task on Timer finish. So How can I achieve this.
The right way to schedule tasks based on time or certain constraints (e.g when device is idle, or when it is charging etc) is by using WorkManager
. Take a look at it:
https://developer.android.com/topic/libraries/architecture/workmanager/
Specifically, for recurring tasks, have a look at this section: https://developer.android.com/topic/libraries/architecture/workmanager/basics#recurring