语言

Menu
Sites
Language
How can I sharing local storage(preference) between web app and widget(native)?

Hi,

These apps are packaged to main web app and native widget board.

If the main web app saved the data in storage using localStorage or widget.preference API,

the widget export and use the saved data?

Thank you.

响应

1 回复
Mehedi Alamgir

Aplications 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. You can set and get data in the data  directory using the Preference API functions. 

Read the "Data Sharing Between the Widget Application and Other Applications" section from the following link

https://developer.tizen.org/development/api-guides/native-application/application-framework/widget-application