Languages

Menu
Sites
Language
localStorage does not save/modify data (HYBRID app, GEAR S2)

I got a strange situation. I have a hybrid application. When I launch a wearable web UI app, it works with localStorage fine: it is possible to create keys with data and after closing UI app, it is possible to retrieve them back at next launch. BUT!!!  Sometimes I need to launch my UI app. from native service app using appcontol feature, and when I do that, localStorage in web UI app. begin to work like session storage, i.e. localStorage data and keys which were created by UI app(after launching it from service) are available until UI app would be closed. 

P.S.: Tizen SDK v.2.4.0_Rev8

Responses

2 Replies
Armaan-Ul- Islam

Hello,

Launching an application with the App Control API is possible using following methods:

Explicit launch: Launch the application with the application ID.

Implicit launch: Launch the application with an operation, URI, or MIME type.

Please share which formation you are using URI/ MIME/Operation

app_control_h app_control;
app_control_create(&app_control);
app_control_set_operation(app_control, APP_CONTROL_OPERATION_VIEW);
app_control_set_uri(app_control, "file:///home/myhome/Photos/1_photo.jpg");
app_control_set_mime(app_control, "image/*");

or you are launching your app using the app id...

app_control_h app_control;
app_control_create(&app_control);
app_control_set_operation(app_control, APP_CONTROL_OPERATION_DEFAULT);
app_control_set_app_id(app_control, "org.tizen.yourWebApp");

And also share the Mode of operation (APP_CONTROL_OPERATION_VIEW /APP_CONTROL_OPERATION_DEFAULT/ APP_CONTROL_OPERATION_LAUNCH_ON_EVENT  or else) you are setting to perform the launch.

Thank you.

 

Vlad Shevchenko

Looks like somthing wrong with localStorage. I tested this issue on empty web application and got a same result in about 70 percent.

The reproducing steps are next:

1. Create a simple web app.

2. Call localStorage.setItem("YOUR KEY", "YOUR DATA").

3. Call tizen.application.getCurrentApplication.exit();

4. Launch your app again and check does your data exist or not.

If to add a short timeout before call tizen.application.getCurrentApplication.exit() - all is OK.