From: Donghyun Lee Date: Tue, 15 Dec 2015 10:33:31 +0000 (+0900) Subject: update widget_n.htm X-Git-Tag: tizen_3.0/TD_SYNC/20161201~275 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2531bf26a2031494ef08c2a66f994f0a5328b779;p=sdk%2Fonline-doc.git update widget_n.htm --- diff --git a/org.tizen.guides/html/images/mobile_s_n_optional.png b/org.tizen.guides/html/images/mobile_s_n_optional.png new file mode 100644 index 0000000..5cf5b18 Binary files /dev/null and b/org.tizen.guides/html/images/mobile_s_n_optional.png differ diff --git a/org.tizen.guides/html/images/wearable_s_n_optional.png b/org.tizen.guides/html/images/wearable_s_n_optional.png new file mode 100644 index 0000000..b7921b6 Binary files /dev/null and b/org.tizen.guides/html/images/wearable_s_n_optional.png differ diff --git a/org.tizen.guides/html/images/widget_data_control_share.png b/org.tizen.guides/html/images/widget_data_control_share.png new file mode 100644 index 0000000..e35f284 Binary files /dev/null and b/org.tizen.guides/html/images/widget_data_control_share.png differ diff --git a/org.tizen.guides/html/images/widget_data_share.png b/org.tizen.guides/html/images/widget_data_share.png new file mode 100644 index 0000000..23d1125 Binary files /dev/null and b/org.tizen.guides/html/images/widget_data_share.png differ diff --git a/org.tizen.guides/html/native/app/widget_n.htm b/org.tizen.guides/html/native/app/widget_n.htm index 58cb66b..02bf99b 100644 --- a/org.tizen.guides/html/native/app/widget_n.htm +++ b/org.tizen.guides/html/native/app/widget_n.htm @@ -24,6 +24,7 @@

Related Info

Widget Application States and Events

@@ -162,6 +175,37 @@ widget_app_create(void *user_data) } +

Data Sharing Between the Widget Application and Other Applications

+ +

You can share data between widget applications and UI (or service) applications. However, you must understand that this kind of data sharing is based on the file system. The reason is that the system (Home screen) controls the widget application life-cycle, while the UI application life-cycle is mostly explicitly controlled by the user.

+ +

For example, consider the differences between a Weather application and a Weather widget:

+ + +

Although the widget wants to share some data from the Weather application (such as the user's favorite city), it is ineffective for the widget to launch the Weather application every time to retrieve such data. This inefficiency makes it difficult to use typical IPC mechanisms, such as socket and Message Port, in which both the receiver and sender processes must be alive for communication. To overcome this issue, the widget application must use a communication type where the data is permanently stored somewhere in the system.

+ +

In the Tizen platform, applications in the same package (including widget applications) can access files in the data directory of the package installation path. This means that the UI (or service) application can first write files to the data directory, and the widget can later read them, or vice versa.

+ +

Figure: Sharing through the data directory

+

Sharing through the data directory

+ +

To manage data through the data directory:

+ + + +

If an application requires complex control over a widget, such as Music Player, it must implement a service application in the middle and use the Data Control API (in mobile and wearable applications).

+

For example, a music-player-service service application is needed to control the audio device, process audio files, and handle play and stop signals. The music-player-ui and music-player-widget applications display the UI controls, title, album arts, and other content retrieved from the music-player-service service application. The service application can export its data using the Data Control to provide data to the other applications (widget and UI) simultaneously.

+ +

The following figure illustrates typical data control flows between the set of UI, service, and widget applications.

+ +

Figure: Sharing through data control

+

Sharing through data control