Title: Samsung Enterprise Portal mySingle

Hi Philippe,

 

Sorry for your frustration and many hours of hard work trying to figure out the problem.

 

> Now the first problem is that getContent() always returns an empty object instead of the item sent before.

getContent() for web widgets is, unfortunately, not supported. We understand that the document

https://developer.tizen.org/development/guides/web-application/application-management/application-information-and-controls/widget-information

can be misleading. We will work with the document team to deliver clearer information.

Meanwhile, please also refer to the following document

https://developer.tizen.org/dev-guide/2.3.2/org.tizen.web.apireference/html/widget_spec/web_widget.html

It documents further unsupported methods for Web widgets (you can find that at the bottom of the page).

 

> 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?!?

To send and receive data to other Web widgtets or application from Web widget, we need to use Preference API.

Briefly, it allows to store and read (key, value) pairs, so that Web widgets can send and receive data.

The above document has a link to Preference API (again at the bottom of the page)

 

I am sorry again for not spending your valuable time as you intended. If you have further questions, please

do not hesitate to send us an email.

 

Ryan

 

--------- Original Message ---------

Sender : 강현호 <hhstark.k...@samsung.com> Engineer/Tizen Platform Lab(S/W센터)/삼성전자

Date : 2017-03-22 14:30 (GMT+9)

Title : Re: [Dev] [Wearable][Web][Widget] DISASTER!

 

> From: Dev [mailto:dev-boun...@lists.tizen.org] On Behalf Of Philippe 
> Wechsler
> Sent: Tuesday, March 21, 2017 5:56 AM
> To: dev@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: 
> https://developer.tizen.org/forums/web-application-development/wearabl
> e-readwrite-widget-content &
> https://developer.tizen.org/forums/web-application-development/widgets
> ervice-sendcontent-getcontent Problem 2: 
> https://developer.tizenorg/forums/web-application-development/retrieve
> -own-widget-id Problem 3:
> https://developer.tizen.org/ko/forums/native-application-development/m
> ultiple-widgets?langswitch=ko (applies to native and web, but only
> wearable)
>
> 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
> Philippe


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.

_______________________________________________
Dev mailing list
Dev@lists.tizen.org
https://lists.tizen.org/listinfo/dev

----

최현 / Ryan Hyun Choi, Ph.D.

Senior Engineer

Web Platform Lab

Software R&D Center

Samsung Electronics Co., Ltd

email: ryan.c...@samsung.com

 

 

_______________________________________________
Dev mailing list
Dev@lists.tizen.org
https://lists.tizen.org/listinfo/dev

Reply via email to