Instance ID of a widget
Posted: 20 Feb 2014 21:58
Hi,
I looking for a way to re-use one widget but distinguish between each instance of the widgets.
Basically, what I want to do is to control some electrical devices which are connected to my web server.
I would like to place 10-20 widgets on my home screen and each instance should have a different ID when creating the HTTP GET calls:
Widget instance 1: tool.php?device=1&action=on/off
Widget instance 2: tool.php?device=2&action=on/off
... and so on
Is there a smart way of doing this without needing to making n copies of the widget and modify the action for each one of them? I'm not able to figure this out...
Same would apply for the other direction, is there a way to access a specific instance of a widget through setWidgetElementProperty() ? This should be used for setting the current status of each widget instance. By using setWidgetElementProperty() ALL instances of the widget will get updated...
Thanks for a great app!!
I looking for a way to re-use one widget but distinguish between each instance of the widgets.
Basically, what I want to do is to control some electrical devices which are connected to my web server.
I would like to place 10-20 widgets on my home screen and each instance should have a different ID when creating the HTTP GET calls:
Widget instance 1: tool.php?device=1&action=on/off
Widget instance 2: tool.php?device=2&action=on/off
... and so on
Is there a smart way of doing this without needing to making n copies of the widget and modify the action for each one of them? I'm not able to figure this out...
Same would apply for the other direction, is there a way to access a specific instance of a widget through setWidgetElementProperty() ? This should be used for setting the current status of each widget instance. By using setWidgetElementProperty() ALL instances of the widget will get updated...
Thanks for a great app!!