Updating the homescreen content
The homescreen does not offer any interactivity with the user. The only interaction with a homescreen portion
of a widget is launching the full view of the widget. However, dynamic content can be introduced to the
homescreen view by updating the view, for example by timer. Basically, the homescreen view should show a
subset of the widget?s most important information. This might be, for example, the local forecast from a
weather widget, or upcoming appointments from a calendar widget. It is recommended to remove any
continuously updating media, such as video and flash animation.
What you can do is implement a timer to update important data to the homescreen. A timer event can, for
example, trigger network operations, parse data, or simply select some other already-gathered information.
Keep in mind, however, that data updates may not always be consistent due to suspended network access
caused by phone calls, low battery, and so on. See section "Informing the widget of online/offline status" to
better handle situations, when a network connection is not available. However, the APIs described in that
chapter are only for limited set of devices, and do not let you re-activate a network access. They are ment to
give you feedback about the network access status for a better fallback handling in case of an error. I
// Start the timer, which refreshes the homescreen view.
var refreshRate = 30000;
var self = this;
this.timerId = setInterval( function(){
self.refresh();
}, refresh );