4 #include <app_common.h>
5 #include <service_app.h>
7 static bool app_create(void *data)
9 /* Hook to take necessary actions before main event loop starts
10 Initialize UI resources and application's data
11 If this function returns true, the main loop of application starts
12 If this function returns false, the application is terminated */
19 static void app_control(app_control_h app_control, void *data)
21 /* Handle the launch request. */
24 static void app_terminate(void *data)
26 /* Release all resources. */
29 int main(int argc, char *argv[])
33 service_app_lifecycle_callback_s event_callback;
34 memset(&event_callback, 0x0, sizeof(service_app_lifecycle_callback_s));
36 event_callback.create = (service_app_create_cb)app_create;
37 event_callback.terminate = (service_app_terminate_cb)app_terminate;
38 event_callback.app_control = (service_app_control_cb)app_control;
40 ret = service_app_main(argc, argv, &event_callback, NULL);
41 if (ret != APP_ERROR_NONE) {
42 LOGE("app_main() is failed. err = %d", ret);