Depending on your requirements, if you only need the tasks to run while the app is running in the foreground, you can use
coroutines to schedule and run work in the future, as well as cancel a coroutine job.
Depending on how long your background tasks run, Android may kill your app if it's in the background. So you might need to use something like
WorkManager on Android.
You can share the coroutines related code, but
WorkManager
is Android only, so you may need to do some implementations in platform source sets with `expect`/`actual`.