[Dev] [Wearable][Web][Widget] DISASTER!
hhstark.kang at samsung.com
Wed Mar 22 05:29:24 GMT 2017
> From: Dev [mailto:dev-bounces at lists.tizen.org] On Behalf Of Philippe
> Sent: Tuesday, March 21, 2017 5:56 AM
> To: dev at lists.tizen.org
> Subject: [Dev] [Wearable][Web][Widget] DISASTER!
> Hi everyone
> For a very long time now I try to get my wearable web app to offer a proper web widget.
> What I've seen so far is just catastrophic: the documentation is absolutely unclear and insufficent and even worse: the implementation is full of bugs.
> The community cannot help as they seem to not understand english or simply have no clue...
> Here's what I want to do: The main app offers an widget which can be added to the homescreen by the user.
> This can be done multiple times so there can be multiple widget instances. This works fine, but there are huge problems to send data to widget instances.
> My odyssee started with the simple task to list all widget instances and send some data to them.
> Using WidgetServiceManager.GetWidget I can successfully receive an widget which can then be used to retrieve all instances of that widget. So far so good.
> Each of this widget instances has a method sendContent() and getContent(). So I successfully sent a different random string to each instance.
> Now the first problem is that getContent() always returns an empty object instead of the item sent before.
> The second problem is that there seems to be no way that a widget instance can retrieve it's own instance id -> which makes the getContent() and sendContent() methods above meaningless!
> Why send data to a widget instance when that widget instance is not able to read that data?!?
> The third problem is a bug that existed since Tizen 2.3.1: each widget instance has its unique id, but after a reboot of the device those id's have changed!
> So even if problem 1 & 2 should be resolved, after every reboot the user has to reconfigure his widgets.
> I've already asked the community but with no success, see
> Problem 1:
> e-readwrite-widget-content &
> ervice-sendcontent-getcontent Problem 2:
> -own-widget-id Problem 3:
> ultiple-widgets?langswitch=ko (applies to native and web, but only
> Is this just my fault as I am doing something wrong? Or are this
> really bugs? If so: how can so many obvious bugs pass any tests? Does Samsung even test what they are providing?
> Thanks for your help
First, really sorry about the documentation. It's getting improved.
About "getContent() always returns an empty object" issue, sendContent is just trigger update event of widget application(Sorry about documentation).
getContent return proper value only if widget application update it's content with widget_app_context_set_content_info API in native widget.
I'm not sure web widget also have widget_app_context_set_content_info API, i'll disscuss it with web widget API developer.
And about instance id(retrieve own widget id, id's have changed) issue, our widget framework is designed intent to managing instance info using content info.
In widget framework instance is literally instance of widget. If widget died, it's instances are also died. When you reboot your system and relaunch widget instance, it is not a same instance. If you want to restore died instance's state, you can use content info to store/restore instance's state.
More information about the Dev