开发者

Is it ok to update a widget frequently for a short period of time?

in numerous places, it is mentioned that app widgets should not get updated often, to minimize power consumption.

But, let's consider that an application is doing something important (such as audio recording) for a short period of time, say 30min.

In this case, is it acceptable to update the widget every second from a service?

How can it be that this would consume so much power?

Please consider that this is d开发者_StackOverflowifferent from a widget which would update very often during the whole day.

And in my case, such frequent updates would be meant to allow the user to monitor that the operation is being performed continuously and correctly. It's not for fancy visual effects and such.


I don't see a problem with doing this; if you're keeping the phone awake with a long-running background task (audio recording in this case), then the phone can't sleep anyway. I wouldn't expect updating the widget to have a significant impact on battery use in this case.

Of course, the best thing to do is to run some tests on a real device, and compare battery use with and without widget updates, and make widget update interval a user preference.


The main reason widgets shouldn't update constantly is because of the battery consumption used to get the latest data from a server. Since the device will be on anyway, and the update is local to your data, it shouldn't have an impact that is noticeable.

If you were hitting a server instead of local data every second for that long, you would notice a significant draw on the battery.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜