Languages

Menu
Sites
Language
[TIZEN 2.3.2 WEARABLE NATIVE WATCHFACE] Communication between Service and Watchface
 

Hello everyone,

I want to create a native watchface, which displays some further information from a webpage, which is constantly updated, besides the time. 

To retrieve the additional information from the webpage constantly, I would use a service (Or is this task possible to perform within the watchface app, e.g. with Ecore_Timer?), and package service and watchface app together. 

But how can the service app share the retrived string with the watchface? 

I found the following options, but couldn´t get it to work so far:

- using add_extra_data with app_control -> no option, because service shall not launche watchface, and the added extra data is here retrieved with the launch request (?)

- Message Port: How are the ports registered in the watch face life cycle?

-app_preference: How are the value key pairs retrieved with the  preference_changed_cb(const char *key, void *user_data) in the watchface every time the service updates them?

Best Regards

 

Edited by: Lee on 06 Feb, 2018
View Selected Answer

Responses

2 Replies
Mark as answer
Yasin Ali

Hi,

There are various interesting ways for app to app data passing/
communication.

You can use the following application data exchange features in your native applications:
•Message Port
 
Applications communicate with each other using message ports. You can send and receive messages using the map data format and trusted or untrusted message port instances.

•Data Control
You can exchanging SQL- or key-value-type data between applications. All applications can request data shared by other applications, but only service applications can provide their own data.

•Data Bundle
You can package data with a bundle, which is a string-based dictionary abstract data type. You can create bundles, manage their content, access their content through iteration, and encode and decode them.

Check this thread for better understanding: https://developer.tizen.org/ko/forums/native-application-development/communication-between-native-service-or-app-and-widget?langswitch=ko

For tutorial on "Using Bi-directional Communication: To send a message from Application 1 to Application 2, and from Application 2 to Application 1"
See this link: https://developer.tizen.org/dev-guide/2.4/org.tizen.tutorials/html/native/app_framework/message_port_tutorial_n.htm

Hope it will help you.
If you find my post is helpful for you, please mark it as answer to promote this post to others.

Lee

Hi Yasin Ali, 

Thank you very much for your answer and the links for the examples.