Tizen native service app to check if another web app is running

Tizen native service app to check if another web app is running

BY 17 Jun 2017 Native Application Development

In Samsung gear S3, I want to develop a Tizen native service application which continuously checks if a web application is running or not and launches the web application if its not running. By continuously, I mean it can be either checking every minute or adding an event listener (for state change of application). I wanted to do this because my web application is getting terminated after some time (may be after a day or so) but I want it to run always in background. Right now,I was able to launch the web application from service application with the following code.

app_control_h app_control;
int ret = APP_CONTROL_ERROR_NONE;
ret = app_control_create(&app_control);

if (ret != APP_CONTROL_ERROR_NONE)
   dlog_print(DLOG_ERROR, LOG_TAG, "app_control_create() is failed. err = %d", ret);

ret = app_control_set_operation(app_control, APP_CONTROL_OPERATION_VIEW);

if (ret != APP_CONTROL_ERROR_NONE)
   dlog_print(DLOG_ERROR, LOG_TAG, "app_control_set_operation() is failed. err = %d", ret);

app_control_set_app_id(app_control, "08CCMUEFHN.ROAMMprompt");

ret = app_control_send_launch_request(app_control, NULL, NULL);
if (ret != APP_CONTROL_ERROR_NONE)
   dlog_print(DLOG_ERROR, LOG_TAG, "app_control_send_launch_request() is failed. err = %d", ret);

I am new to the native app development in C. Kindly please help me in developing code to continuously check if my web application is running or not.

Regards,

Manoj.

Written by