Update widget data - update time

1

I'm creating an application that will have a widget, in it will be presented some data taken from a webservice. I need it to refresh every 5 minutes to get some fresh information from the user.

The documentation of the AppWidgetProvider says update requests will be made only over 30 mins, nothing below that , to save battery life and unnecessary use.

I've been researching, and in the English stack, a solution using the AlarmManager to solve.

I do not know what the best way to handle this is if there is any way to upgrade in a shorter time.

    
asked by anonymous 26.05.2017 / 13:44

1 answer

2

A found solution of AlarmManager not to be ignored. The benefits of this approach is the ability to configure the update time, and also handle the sleeping device case ". But you have to think about whether the upgrade time really needs to be different from the suggestion that includes documentation . Nowadays we still have this problem of battery, in which a device, even in standby , consumes a considerable amount of load.

Many updates to widgets end up becoming a threat to your app , so if it is not among the most useful ones installed on the device , the user may come to undo your application by uninstalling it. It really is necessary to reevaluate this issue in relation to necessity.

    
26.05.2017 / 15:55