So, if the user sets the refresh period to 5s, will this be a huge problem for his battery
Yes. On the other hand, if the user requested that, so long as the user is aware of the power drain, that is the user's choice. I would default to something much less frequent, like once an hour.
Note : i'm already using setInexactRepeating instated of setRepeating on my AlarmManager.
setInexactRepeating()
only has the "inexact" effect if you choose one of the stock values (e.g., INTERVAL_FIFTEEN_MINUTES
) or are running on API Level 19+. If you want to leverage that "inexact" nature for power savings, you should only allow the user to choose one of the INTERVAL_*
values.
Also, depending upon what "user notifications" are, consider using GCM to push them down, rather than using frequent polling.