I have an AlarmManager that triggers an alarm every X minutes.
When the alarm is trigger I'm doing a few operations like reading a small file and updating the SharedPreferences.
What is recommended to use for these operations in this case?
A service seems fitting but since these are relatively short operations, maybe a BroadcastReceiver is better (lighter?)?
It seems that both BroadcastReceiver and a Service are running on the same process and on the UI thread and the only difference is how and when Android is killing them. Is that correct?
As far as I understand the AlarmManger can either call a Receiver or a Service (or an Activity but that's irrelevant now). My alarm runs always, even when my app is not running. So either way (a service or a broadcastreceiver) will start my process if it's my app isn't running. The alarm can go off every even 10 seconds, it depends on the user. So in that case, IntentService will have to start a thread every 10 seconds. Isn't that "harsh" on the system? Thanks.