I am using a ScheduledThreadPoolExecutor in my application where I need consistent, precise timing with a delay of 2 seconds.
When would AlarmManager be preferred and from the API docs, it seems like it'd be more power efficient. Is one "meant" more to be used as a background processor or foreground? Would there be any hardware limitations, ie. If I use AlarmManager, would I be able to access the camera for instance as long as I requested that permission? Or, is that resource out of scope in this context?
JobScheduler is out of the question for me because that appears to require a 15 minute interval at a minimum.
Handler only appears to function when the app is in the foreground.
Are those my only options?