Skip to content Skip to sidebar Skip to footer

Widget That Retrieve Data From Several Html Pages

I retrieve some data from html after several step (login, click on link, run javascript, etc.) using webview, like described here: how to get html content from a webview? putting m

Solution 1:

It is probably a good idea to perform the background work on a Service or some other independent structure, fireing an update to the widget or performing an direct update on all widgets afterwards, which then causes the fresh data to get displayed.


Without knowing anything about your exact project, the cleanest way would probably be a SyncAdapter, peforming the synchronization in the background and updating a ContentProvider which can then get used when updating the widget.

However this may be overkill (you need to register a sync account in the system, etc), depending on your actual needs. You could as well just have a Service the widget may request an update on, which then fires an update using the same technique once it finished loading.

Oh, and if you're bound to exactly 12 AM, have a look at AlarmManager.

Post a Comment for "Widget That Retrieve Data From Several Html Pages"