Tizen Native API
5.5
|
Launches or exits serviceApp.
#include <service_app.h>
The Service Application API provides functions for handling Tizen service application state changes or system events. This API provides interfaces for the following three categories:
Functions | |
int | service_app_add_event_handler (app_event_handler_h *handler, app_event_type_e event_type, app_event_cb callback, void *user_data) |
Adds the system event handler. | |
int | service_app_remove_event_handler (app_event_handler_h event_handler) |
Removes registered event handler. | |
int | service_app_main (int argc, char **argv, service_app_lifecycle_callback_s *callback, void *user_data) |
Runs the main loop of the application until service_app_exit() is called. | |
void | service_app_exit (void) |
Exits the main loop of the application. | |
Typedefs | |
typedef bool(* | service_app_create_cb )(void *user_data) |
Called at the start of the agent application. | |
typedef void(* | service_app_terminate_cb )(void *user_data) |
Called once after the main loop of the agent application exits. | |
typedef void(* | service_app_control_cb )(app_control_h app_control, void *user_data) |
Called when another application sends the launch request to the agent application. |
typedef void(* service_app_control_cb)(app_control_h app_control, void *user_data) |
Called when another application sends the launch request to the agent application.
[in] | app_control | The handle to the app_control |
[in] | user_data | The user data passed from the callback registration function |
typedef bool(* service_app_create_cb)(void *user_data) |
Called at the start of the agent application.
[in] | user_data | The user data passed from the callback registration function |
true
on success, otherwise false
typedef void(* service_app_terminate_cb)(void *user_data) |
Called once after the main loop of the agent application exits.
[in] | user_data | The user data passed from the callback registration function |
int service_app_add_event_handler | ( | app_event_handler_h * | handler, |
app_event_type_e | event_type, | ||
app_event_cb | callback, | ||
void * | user_data | ||
) |
Adds the system event handler.
[out] | handler | The event handler |
[in] | event_type | The system event type |
[in] | callback | The callback function |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error value APP_ERROR_NONE | Successful |
APP_ERROR_INVALID_PARAMETER | Invalid parameter |
APP_ERROR_OUT_OF_MEMORY | Out of memory |
void service_app_exit | ( | void | ) |
Exits the main loop of the application.
The main loop of the application stops and service_app_terminate_cb() is invoked.
int service_app_main | ( | int | argc, |
char ** | argv, | ||
service_app_lifecycle_callback_s * | callback, | ||
void * | user_data | ||
) |
Runs the main loop of the application until service_app_exit() is called.
This function is the main entry point of the Tizen service application. This main loop supports event handling for the GMainLoop and the Ecore Main Loop.
[in] | argc | The argument count |
[in] | argv | The argument vector |
[in] | callback | The set of callback functions to handle application events |
[in] | user_data | The user data to be passed to the callback functions |
0
on success, otherwise a negative error value. APP_ERROR_NONE | Successful |
APP_ERROR_INVALID_PARAMETER | Invalid parameter |
APP_ERROR_INVALID_CONTEXT | The application is launched illegally, not launched by the launch system. |
APP_ERROR_ALREADY_RUNNING | The main loop has already started |
int service_app_remove_event_handler | ( | app_event_handler_h | event_handler | ) |
Removes registered event handler.
[in] | event_handler | The event handler |
0
on success, otherwise a negative error value APP_ERROR_NONE | Successful |
APP_ERROR_INVALID_PARAMETER | Invalid parameter |