Efl을 이용한 타이젠 네이티브 웨어러블 앱 만들기 박진솔
소개 박진솔 EFL 한국 커뮤니티 운영진 삼성전자 Tizen Platform – UIFW, TV Profile Heavensbus@gmail.com
목차 EFL? EFL 한국 커뮤니티 TIZEN? SDK 설치 프로젝트 만들어 보기 샘플코드 개발이 막힐 때
efl? No!!!!! Executable and Linkable Format Enlightenment Foundation Library Window Manager Unity, Gnome shell , Lxde, Xfce, KDE etc… https://www.enlightenment.org
efl?
efl 한국 커뮤니티 https://www.facebook.com/enlightenment.or.kr http://efl.or.kr
TIZEN Linux Foundation Project Mobile – Native/Web Samsung Electronics, Intel, etc... Profile - Mobile, Wearable, TV, IVI, etc TV - Native not support Smart TV Mobile – Native/Web Samsung Z, Z3 Wearable – Native/Web Samsung Gear, Gear2, Gear S, Gear S2
Tizen
Tizen
Tizen
Tizen sdk Tizen.org SDK Eclipse base Repo – Git 지원 OS Gerrit (Git review system) GBS (Git Build System) 지원 OS Ubuntu Windows Mac Tizen Platform 최신버전은 2.4 http://tizen.org
Tizen sdk
TIZEN SDK Wearable Profile latest version 2.3.1
TIZEN SDK
Emulator create
Project create Tizen Native Project
Project create Basic UI Hello Tizen!
Project create Template - Basic UI
basic ui에서 하는일 - 초기화 int main(int argc, char *argv[]) { event_callback.create = app_create; event_callback.terminate = app_terminate; event_callback.pause = app_pause; event_callback.resume = app_resume; event_callback.app_control = app_control; ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, ui_app_orient_changed, &ad); ret = ui_app_main(argc, argv, &event_callback, &ad); return ret; }
basic ui에서 하는일 - 핸들러 event_callback.create = app_create; static bool app_create(void *data) { /* Hook to take necessary actions before main event loop starts Initialize UI resources and application's data If this function returns true, the main loop of application starts If this function returns false, the application is terminated */ appdata_s *ad = data; create_base_gui(ad); return true; } event_callback.create = app_create;
basic ui에서 하는일 – 화면 구성 static void create_base_gui(appdata_s *ad) { /* Window create */ ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE); if (elm_win_wm_rotation_supported_get(ad->win)) { int rots[4] = { 0, 90, 180, 270 }; elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4);
basic ui에서 하는일 – 화면 구성 static void create_base_gui(appdata_s *ad) { evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL); eext_object_event_callback_add(ad->win, EEXT_CALLBACK_BACK, win_back_cb, ad);
basic ui에서 하는일 – 화면 구성 static void create_base_gui(appdata_s *ad) { /* Label */ ad->label = elm_label_add(ad->conform); elm_object_text_set(ad->label, "<align=center>Hello Tizen</align>"); evas_object_size_hint_weight_set(ad->label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_object_content_set(ad->conform, ad->label); /* Show window after base gui is set up */ evas_object_show(ad->win); }
run
run
run
Project create Basic UI UI Builder Watch Widget Service Lib
UI Builder
widget
UI Builder
UI Builder
gear watch designer http://developer.samsung.com/gear/design/watch-designer 간단한 Watch face를 만들고 싶을때는..
watch app - 초기화 int main(int argc, char *argv[]) { event_callback.create = app_create; event_callback.terminate = app_terminate; event_callback.pause = app_pause; event_callback.resume = app_resume; event_callback.app_control = app_control; event_callback.time_tick = app_time_tick; event_callback.ambient_tick = app_ambient_tick; event_callback.ambient_changed = app_ambient_changed; ret = watch_app_main(argc, argv, &event_callback, &ad); return ret; }
watch app - UI구성 static void create_base_gui(appdata_s *ad, int width, int height) { /* Window */ ret = watch_app_get_elm_win(&ad->win); evas_object_resize(ad->win, width, height); /* Label*/ ad->label = elm_label_add(ad->conform); evas_object_resize(ad->label, width, height / 3); evas_object_move(ad->label, 0, height / 3); ret = watch_time_get_current_time(&watch_time); update_watch(ad, watch_time, 0); }
watch app – ambient mode
watch app – 시간이 지나가면 static void app_time_tick(watch_time_h watch_time, void *data) { /* Called at each second while your app is visible. Update watch UI. */ appdata_s *ad = data; update_watch(ad, watch_time, 0); } static void app_ambient_tick(watch_time_h watch_time, void *data) /* Called at each minute while the device is in ambient mode. Update watch UI. */ update_watch(ad, watch_time, 1);
watch app - UI구성 static void update_watch(appdata_s *ad, watch_time_h watch_time, int ambient) { char watch_text[TEXT_BUF_SIZE]; int hour24, minute, second; watch_time_get_hour24(watch_time, &hour24); watch_time_get_minute(watch_time, &minute); watch_time_get_second(watch_time, &second); if (!ambient) snprintf(watch_text, TEXT_BUF_SIZE, "<align=center>Hello Watch<br/>%02d:%02d:%02d</align>", hour24, minute, second); else snprintf(watch_text, TEXT_BUF_SIZE, "<align=center>Hello Watch<br/>%02d:%02d</align>", hour24, minute); elm_object_text_set(ad->label, watch_text); }
sample code
guide https://developer.tizen.org/ko/development/getting-started/native-application
하다가 막히면!? http://efl.or.kr
하다가 막히면!? Tizen.rog Forum에 질문
하다가 막히면!?
질문/답변
감사합니다. EFL 한국 커뮤니티 http://efl.or.kr