3 #include <app_common.h>
4 #include <service_app.h>
6 static bool app_create(void *data)
8 /* Hook to take necessary actions before main event loop starts
9 Initialize UI resources and application's data
10 If this function returns true, the main loop of application starts
11 If this function returns false, the application is terminated */
18 static void app_control(app_control_h app_control, void *data)
20 /* Handle the launch request. */
23 static void app_terminate(void *data)
25 /* Release all resources. */
28 int main(int argc, char *argv[])
32 service_app_lifecycle_callback_s event_callback;
33 memset(&event_callback, 0x0, sizeof(service_app_lifecycle_callback_s));
35 event_callback.create = (service_app_create_cb)app_create;
36 event_callback.terminate = (service_app_terminate_cb)app_terminate;
37 event_callback.app_control = (service_app_control_cb)app_control;
39 ret = service_app_main(argc, argv, &event_callback, NULL);
40 if (ret != APP_ERROR_NONE) {
41 dlog_print(DLOG_ERROR, TAG, "app_main() is failed. err = %d", ret);