If i close app(System.exit) and Service can do background task( with "android:process", so called another process).
But what if i don't even use Service, what can be next alternative?
Thread can not be survive from closing(System.exit).
Alarm Manger can survive and do periodic task, but not continues background task. (As far as i know Alarm Manager can do task only every minuete. not every seconds)
But what about JobService, WorkManager, Firebase JobDispatcher, SyncAdapter?
Can these be survive from System.exit? and can do task every seconds base task?
My first question is why you want to keep doing something even though the user has killed your application.
JobService
, WorkManager
, Firebase JobDispatcher
act like Alarm Manager and will run periodically but with longer intervals (15 mins).
SyncAdapter
Requires a service to run.
A Service appears to be your only option but the user can still kill it by going to settings and force closing your application and all of its services.