[TIZEN] Added Resource Container Discovery in Sample client application.
authorarya.k <arya.kumar@samsung.com>
Mon, 14 Sep 2015 05:37:59 +0000 (11:07 +0530)
committerMadan Lanka <lanka.madan@samsung.com>
Tue, 15 Sep 2015 08:34:48 +0000 (08:34 +0000)
Resolved build errors for Sample Server application.

Change-Id: I96065e2b9eb8a85cb5936fb55e769bb33a25e252
Signed-off-by: arya.k <arya.kumar@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2474
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
14 files changed:
service/resource-encapsulation/examples/tizen/RESampleClientApp/edc_resource/re_client_control.edc
service/resource-encapsulation/examples/tizen/RESampleClientApp/edc_resource/re_container_control.edc [new file with mode: 0644]
service/resource-encapsulation/examples/tizen/RESampleClientApp/inc/reclient.h
service/resource-encapsulation/examples/tizen/RESampleClientApp/inc/reclientmain.h
service/resource-encapsulation/examples/tizen/RESampleClientApp/inc/recontainerclient.h [new file with mode: 0644]
service/resource-encapsulation/examples/tizen/RESampleClientApp/res/ui_controls.edc
service/resource-encapsulation/examples/tizen/RESampleClientApp/src/reclient.cpp
service/resource-encapsulation/examples/tizen/RESampleClientApp/src/reclientmain.cpp
service/resource-encapsulation/examples/tizen/RESampleClientApp/src/recontainerclient.cpp [new file with mode: 0644]
service/resource-encapsulation/examples/tizen/RESampleServerApp/inc/recontainer.h
service/resource-encapsulation/examples/tizen/RESampleServerApp/inc/remain.h
service/resource-encapsulation/examples/tizen/RESampleServerApp/inc/reserver.h
service/resource-encapsulation/examples/tizen/RESampleServerApp/inc/reservermain.h
service/resource-encapsulation/examples/tizen/RESampleServerApp/src/reservermain.cpp

index 0c868eb..e936bbb 100644 (file)
@@ -34,7 +34,7 @@ group
             description
             {
                 rel1.relative: 0.01 0.01;
-                rel2.relative: 0.5 0.09;
+                rel2.relative: 0.7 0.09;
             }
         }
         part
diff --git a/service/resource-encapsulation/examples/tizen/RESampleClientApp/edc_resource/re_container_control.edc b/service/resource-encapsulation/examples/tizen/RESampleClientApp/edc_resource/re_container_control.edc
new file mode 100644 (file)
index 0000000..e394253
--- /dev/null
@@ -0,0 +1,123 @@
+/******************************************************************
+ *
+ * Copyright 2015 Samsung Electronics All Rights Reserved.
+ *
+ *
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************/
+
+group
+{
+    name: "container_layout";
+    parts
+    {
+        part
+        {
+            name: "listnew";
+            type: SWALLOW;
+            scale: 1;
+            description
+            {
+                rel1.relative: 0.01 0.1;
+                rel2.relative: 0.99 0.7;
+            }
+        }
+        part
+        {
+            name: "log_bg";
+            type: RECT;
+            scale: 1;
+            description
+            {
+                state: "default" 0.0;
+                rel1.relative: 0.01 0.71;
+                rel2.relative: 0.98 1.0;
+                color: 220 220 220 255;
+            }
+        }
+        part
+        {
+            name: "log";
+            type: SWALLOW;
+            scale: 1;
+            description
+            {
+                rel1.to: "log_bg";
+                rel2.to: "log_bg";
+            }
+        }
+    }
+}
+
+group
+{
+    name: "popup_datetime_text";
+    parts
+    {
+        part
+        {
+            name: "pad_l";
+            type: SPACER;
+            scale: 1;
+            description
+            {
+                state: "default" 0.0;
+                min: POPUP_CONTENT_DEFAULT_PADDING_LEFT_MIN_INC 0;
+                fixed: 1 0;
+                rel1.relative: 0.0 0.0;
+                rel2.relative: 0.0 1.0;
+                align: 0.0 0.0;
+            }
+        }
+        part
+        {
+            name: "pad_r";
+            type: SPACER;
+            scale: 1;
+            description
+            {
+                state: "default" 0.0;
+                min: POPUP_CONTENT_DEFAULT_PADDING_LEFT_MIN_INC 0;
+                fixed: 1 0;
+                rel1.relative: 1.0 0.0;
+                rel2.relative: 1.0 1.0;
+                align: 1.0 0.0;
+            }
+        }
+        part
+        {
+            name: "elm.swallow.content";
+            type: SWALLOW;
+            scale: 1;
+            description
+            {
+                state: "default" 0.0;
+                min: 0 POPUP_EDITFIELD_LAYOUT_MINMAX_HEIGHT_INC;
+                max: -1 POPUP_EDITFIELD_LAYOUT_MINMAX_HEIGHT_INC;
+                align: 0.5 0.5;
+                rel1
+                {
+                    relative: 1.0 0.0;
+                    to_x: "pad_l";
+                }
+                rel2
+                {
+                    relative: 0.0 1.0;
+                    to_x: "pad_r";
+                }
+            }
+        }
+    }
+}
index 421def2..c8734dc 100644 (file)
  *
  ******************************************************************/
 
-#ifndef __RECLIENT_H__
-#define __RECLIENT_H__
+#ifndef RECLIENT_H__
+#define RECLIENT_H__
 
 typedef void(*ClientMenuHandler)();
 typedef int ReturnValue;
 
-void *showGroupAPIs(void *data);
+void *showClientAPIs(void *data);
 
-#endif // __RECLIENT_H__
+#endif // RECLIENT_H__
\ No newline at end of file
index 9035922..cc9a5b1 100644 (file)
@@ -18,8 +18,8 @@
  *
  ******************************************************************/
 
-#ifndef __RECLIENTMAIN_H__
-#define __RECLIENTMAIN_H__
+#ifndef RECLIENTMAIN_H__
+#define RECLIENTMAIN_H__
 
 #include <app.h>
 #include <Elementary.h>
@@ -45,4 +45,6 @@ using namespace OC;
 
 void group_cb(void *data, Evas_Object *obj, void *event_info);
 
-#endif // __RECLIENTMAIN_H__
+void containerCreateUI(void *data, Evas_Object *obj, void *event_info);
+
+#endif // RECLIENTMAIN_H__
\ No newline at end of file
diff --git a/service/resource-encapsulation/examples/tizen/RESampleClientApp/inc/recontainerclient.h b/service/resource-encapsulation/examples/tizen/RESampleClientApp/inc/recontainerclient.h
new file mode 100644 (file)
index 0000000..5ec7c79
--- /dev/null
@@ -0,0 +1,48 @@
+/******************************************************************
+ *
+ * Copyright 2015 Samsung Electronics All Rights Reserved.
+ *
+ *
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************/
+
+#include "reclientmain.h"
+
+#include "RCSRemoteResourceObject.h"
+
+#include <app.h>
+#include <Elementary.h>
+#include <system_settings.h>
+#include <efl_extension.h>
+#include <dlog.h>
+
+#ifndef RECONTAINER_H__
+#define RECONTAINER_H__
+
+# define LOG_TAG "recontainerclient"
+
+using namespace OIC::Service;
+
+void *showContainerAPIs(void *data);
+
+void onContainerDiscovered(std::shared_ptr<RCSRemoteResourceObject> foundResource);
+
+static void find_resource_cb(void *data, Evas_Object *obj, void *event_info);
+
+static void findLight(void *data, Evas_Object *obj, void *event_info);
+
+static void findSoftsensor(void *data, Evas_Object *obj, void *event_info);
+
+#endif // RECONTAINER_H__
\ No newline at end of file
index 7e85384..66a5509 100644 (file)
@@ -22,4 +22,5 @@ collections
 {
     base_scale: 1.8;
     #include "../edc_resource/re_client_control.edc"
+    #include "../edc_resource/re_container_control.edc"
 }
\ No newline at end of file
index dda2d01..b07fb17 100644 (file)
@@ -98,7 +98,7 @@ void onResourceDiscovered(std::shared_ptr<RCSRemoteResourceObject> foundResource
 
     resource = foundResource;
 
-    ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))showGroupAPIs, NULL);
+    ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))showClientAPIs, NULL);
     cond.notify_all();
 }
 
@@ -596,7 +596,21 @@ list_scheduled_actionset_cb(void *data, Evas_Object *obj, void *event_info)
     evas_object_show(popup);
 }
 
-void *showGroupAPIs(void *data)
+// Method to be called when the Discover Resource UI Button is selected
+static void
+find_resource_cb(void *data, Evas_Object *obj, void *event_info)
+{
+    if (NULL != list)
+    {
+        discoverResource();
+    }
+    else
+    {
+        dlog_print(DLOG_ERROR, "find_resource_cb", "list is NULL - So unable to add items!!!");
+    }
+}
+
+void *showClientAPIs(void *data)
 {
     // Add items to the list only if the list is empty
     const Eina_List *eina_list = elm_list_items_get(list);
@@ -659,6 +673,7 @@ void group_cb(void *data, Evas_Object *obj, void *event_info)
     Evas_Object *layout;
     Evas_Object *scroller;
     Evas_Object *nf = (Evas_Object *)data;
+    Evas_Object *find_button;
     Elm_Object_Item *nf_it;
 
     naviframe = nf;
@@ -675,6 +690,12 @@ void group_cb(void *data, Evas_Object *obj, void *event_info)
 
     elm_object_content_set(scroller, layout);
 
+    // Button
+    find_button = elm_button_add(layout);
+    elm_object_part_content_set(layout, "find_button", find_button);
+    elm_object_text_set(find_button, "Discover Resource");
+    evas_object_smart_callback_add(find_button, "clicked", find_resource_cb, NULL);
+
     // List
     list = elm_list_add(layout);
     elm_list_mode_set(list, ELM_LIST_COMPRESS);
@@ -693,6 +714,4 @@ void group_cb(void *data, Evas_Object *obj, void *event_info)
 
     nf_it = elm_naviframe_item_push(nf, "Resource Encapsulation", NULL, NULL, scroller, NULL);
     elm_naviframe_item_pop_cb_set(nf_it, naviframe_pop_cb, NULL);
-
-    discoverResource();
 }
index 18825ce..4d3ac6c 100644 (file)
@@ -69,7 +69,9 @@ create_list_view(appdata_s *ad)
     evas_object_smart_callback_add(list, "selected", list_selected_cb, NULL);
 
     // Main Menu Items Here
-    elm_list_item_append(list, "Discover Resource", NULL, NULL, group_cb, nf);
+    elm_list_item_append(list, "Resource Client", NULL, NULL, group_cb, nf);
+
+    elm_list_item_append(list, "Resource Container", NULL, NULL, containerCreateUI, nf);
 
     elm_list_go(list);
 
diff --git a/service/resource-encapsulation/examples/tizen/RESampleClientApp/src/recontainerclient.cpp b/service/resource-encapsulation/examples/tizen/RESampleClientApp/src/recontainerclient.cpp
new file mode 100644 (file)
index 0000000..40662a7
--- /dev/null
@@ -0,0 +1,199 @@
+/******************************************************************
+ *
+ * Copyright 2015 Samsung Electronics All Rights Reserved.
+ *
+ *
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************/
+
+#include "recontainerclient.h"
+
+#include "reclientmain.h"
+#include "RCSDiscoveryManager.h"
+#include "RCSResourceAttributes.h"
+#include "RCSAddress.h"
+
+#include <string>
+#include "mutex"
+#include "condition_variable"
+
+using namespace std;
+using namespace OC;
+using namespace OIC::Service;
+
+std::shared_ptr<RCSRemoteResourceObject>  g_containerResource;
+
+const std::string resourceTypeLight = "?rt=oic.light.control";
+const std::string resourceTypeSoftsensor = "?rt=oic.softsensor";
+const std::string targetLightUri = OC_RSRVD_WELL_KNOWN_URI + resourceTypeLight;
+const std::string targetSoftsensorUri = OC_RSRVD_WELL_KNOWN_URI + resourceTypeSoftsensor;
+
+std::mutex g_containerMtx;
+std::condition_variable g_containerCond;
+
+static Evas_Object *log_entry = NULL;
+static Evas_Object *listnew = NULL;
+static Evas_Object *naviframe = NULL;
+
+// Function to update the log in UI
+void *updateContainerLog(void *data)
+{
+    string *log = (string *)data;
+    // Show the log
+    elm_entry_entry_append(log_entry, (*log).c_str());
+    elm_entry_cursor_end_set(log_entry);
+    return NULL;
+}
+
+static void list_selected_cb(void *data, Evas_Object *obj, void *event_info)
+{
+    Elm_Object_Item *it = (Elm_Object_Item *)event_info;
+    elm_list_item_selected_set(it, EINA_FALSE);
+}
+
+static void onDestroy()
+{
+    g_containerResource = NULL;
+}
+
+void onContainerDiscovered(std::shared_ptr<RCSRemoteResourceObject> foundResource)
+{
+    dlog_print(DLOG_INFO, LOG_TAG, "#### onResourceDiscovered callback");
+
+    std::string resourceURI = foundResource->getUri();
+    std::string hostAddress = foundResource->getAddress();
+
+    dlog_print(DLOG_INFO, LOG_TAG, "#### Resource URI :  %s", resourceURI.c_str());
+    dlog_print(DLOG_INFO, LOG_TAG, "#### Resource Host : %S", hostAddress.c_str());
+
+    string logMessage = "Resource Found <br>";
+    logMessage = logMessage + "URI: " + resourceURI + "<br>";
+    logMessage = logMessage + "Host:" + hostAddress + "<br>";
+    logMessage += "----------------------<br>";
+    dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
+    ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateContainerLog,
+                                          &logMessage);
+
+    g_containerResource = foundResource;
+
+    ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))showContainerAPIs, NULL);
+    g_containerCond.notify_all();
+}
+
+void *showContainerAPIs(void *data)
+{
+    // Add items to the list only if the list is empty
+    const Eina_List *eina_list = elm_list_items_get(listnew);
+    int count = eina_list_count(eina_list);
+    if (!count)
+    {
+        elm_list_item_append(listnew, "1. Find Light resource", NULL, NULL,
+                             findLight, NULL);
+
+        elm_list_item_append(listnew, "1. Find Softsensor resource", NULL, NULL,
+                             findSoftsensor, NULL);
+
+        elm_list_go(listnew);
+    }
+    return NULL;
+}
+
+static void findLight(void *data, Evas_Object *obj, void *event_info)
+{
+    dlog_print(DLOG_INFO, LOG_TAG, "#### Wait 2 seconds until discovered");
+
+    RCSDiscoveryManager::getInstance()->discoverResource(RCSAddress::multicast(), targetLightUri,
+            &onContainerDiscovered);
+
+    std::unique_lock<std::mutex> lck(g_containerMtx);
+    g_containerCond.wait_for(lck, std::chrono::seconds(2));
+
+    dlog_print(DLOG_INFO, LOG_TAG, "#### Light Discovery over");
+}
+
+static void findSoftsensor(void *data, Evas_Object *obj, void *event_info)
+{
+    dlog_print(DLOG_INFO, LOG_TAG, "#### Wait 2 seconds until discovered");
+
+    RCSDiscoveryManager::getInstance()->discoverResource(RCSAddress::multicast(), targetSoftsensorUri,
+            &onContainerDiscovered);
+
+    std::unique_lock<std::mutex> lck(g_containerMtx);
+    g_containerCond.wait_for(lck, std::chrono::seconds(2));
+
+    dlog_print(DLOG_INFO, LOG_TAG, "#### Softsensor Discovery over");
+}
+
+static Eina_Bool
+naviframe_pop_cb(void *data, Elm_Object_Item *it)
+{
+    onDestroy();
+
+    if (NULL != log_entry)
+    {
+        evas_object_del(log_entry);
+        log_entry = NULL;
+    }
+    if (NULL != listnew)
+    {
+        evas_object_del(listnew);
+        listnew = NULL;
+    }
+    return EINA_TRUE;
+}
+
+// Method to set up server screens
+void containerCreateUI(void *data, Evas_Object *obj, void *event_info)
+{
+    Evas_Object *layout;
+    Evas_Object *scroller;
+    Evas_Object *nf = (Evas_Object *)data;
+    Elm_Object_Item *nf_it;
+    naviframe = nf;
+
+    // Scroller
+    scroller = elm_scroller_add(nf);
+    elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_TRUE);
+    elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
+
+    // Layout
+    layout = elm_layout_add(nf);
+    elm_layout_file_set(layout, ELM_DEMO_EDJ, "container_layout");
+    evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+    elm_object_content_set(scroller, layout);
+
+    // List
+    listnew = elm_list_add(layout);
+    elm_list_mode_set(listnew, ELM_LIST_COMPRESS);
+    evas_object_smart_callback_add(listnew, "selected", list_selected_cb, NULL);
+    elm_object_part_content_set(layout, "listnew", listnew);
+    elm_list_go(listnew);
+
+    // log_entry - text area for log
+    log_entry = elm_entry_add(layout);
+    elm_entry_scrollable_set(log_entry, EINA_TRUE);
+    elm_entry_editable_set(log_entry, EINA_FALSE);
+    elm_object_part_text_set(log_entry, "elm.guide", "Logs will be updated here!!!");
+    evas_object_size_hint_weight_set(log_entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+    evas_object_size_hint_align_set(log_entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
+    elm_object_part_content_set(layout, "log", log_entry);
+
+    nf_it = elm_naviframe_item_push(nf, "Resource Container", NULL, NULL, scroller, NULL);
+    elm_naviframe_item_pop_cb_set(nf_it, naviframe_pop_cb, NULL);
+
+    // Show the UI list of group APIs
+    ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))showContainerAPIs, NULL);
+}
index 0191f3a..cb31b74 100644 (file)
@@ -20,8 +20,8 @@
 
 #include "remain.h"
 
-#ifndef __RECONTAINER_H__
-#define __RECONTAINER_H__
+#ifndef RECONTAINER_H__
+#define RECONTAINER_H__
 
 # define LOG_TAG "recontainer"
 
@@ -35,4 +35,4 @@ static void startContainer(void *data, Evas_Object *obj, void *event_info);
 
 static void stopContainer(void *data, Evas_Object *obj, void *event_info);
 
-#endif // __RECONTAINER_H__
+#endif // RECONTAINER_H__
index 2d59bfb..ca6fb73 100644 (file)
@@ -18,8 +18,8 @@
  *
  ******************************************************************/
 
-#ifndef __REMAIN_H__
-#define __REMAIN_H__
+#ifndef REMAIN_H__
+#define REMAIN_H__
 
 #include <app.h>
 #include <Elementary.h>
@@ -47,4 +47,4 @@ void serverCreateUI(void *data, Evas_Object *obj, void *event_info);
 
 void containerCreateUI(void *data, Evas_Object *obj, void *event_info);
 
-#endif // __REMAIN_H__
+#endif // REMAIN_H__
\ No newline at end of file
index 4fb09b9..7e86554 100644 (file)
@@ -22,8 +22,8 @@
 
 #include "RCSResourceObject.h"
 
-#ifndef __RESERVER_H__
-#define __RESERVER_H__
+#ifndef RESERVER_H__
+#define RESERVER_H__
 
 using namespace std;
 using namespace OIC::Service;
@@ -52,4 +52,4 @@ void start_server_cb(void *data, Evas_Object *obj, void *event_info);
 
 void *showGroupAPIs(void *data);
 
-#endif // __RESERVER_H__
+#endif // RESERVER_H__
\ No newline at end of file
index 9a804ab..6f731c7 100644 (file)
@@ -18,8 +18,8 @@
  *
  ******************************************************************/
 
-#ifndef __RESERVERMAIN_H__
-#define __RESERVERMAIN_H__
+#ifndef RESERVERMAIN_H__
+#define RESERVERMAIN_H__
 
 #include <app.h>
 #include <Elementary.h>
@@ -47,4 +47,4 @@ void start_server(void *data, Evas_Object *obj, void *event_info);
 
 void start_server_cb(void *data, Evas_Object *obj, void *event_info);
 
-#endif // __RESERVERMAIN_H__
+#endif // RESERVERMAIN_H__
\ No newline at end of file
index 381406b..6465794 100644 (file)
@@ -78,180 +78,3 @@ create_list_view(appdata_s *ad)
     nf_it = elm_naviframe_item_push(nf, "Resource Encapsulation", btn, NULL, list, NULL);
     elm_naviframe_item_pop_cb_set(nf_it, naviframe_pop_cb, ad->win);
 }
-
-
-static void
-create_base_gui(appdata_s *ad)
-{
-    // Window
-    ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
-    elm_win_conformant_set(ad->win, EINA_TRUE);
-    elm_win_autodel_set(ad->win, EINA_TRUE);
-
-    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);
-    }
-
-    evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
-
-    // Conformant
-    ad->conform = elm_conformant_add(ad->win);
-    evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-    elm_win_resize_object_add(ad->win, ad->conform);
-    evas_object_show(ad->conform);
-
-    // Base Layout
-    ad->layout = elm_layout_add(ad->conform);
-    evas_object_size_hint_weight_set(ad->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-    elm_layout_theme_set(ad->layout, "layout", "application", "default");
-    evas_object_show(ad->layout);
-
-    elm_object_content_set(ad->conform, ad->layout);
-
-    // Naviframe
-    ad->nf = elm_naviframe_add(ad->layout);
-    create_list_view(ad);
-    elm_object_part_content_set(ad->layout, "elm.swallow.content", ad->nf);
-    eext_object_event_callback_add(ad->nf, EEXT_CALLBACK_BACK, eext_naviframe_back_cb, NULL);
-    eext_object_event_callback_add(ad->nf, EEXT_CALLBACK_MORE, eext_naviframe_more_cb, NULL);
-
-    // Show window after base gui is set up
-    evas_object_show(ad->win);
-}
-
-// Configures the OCPlatform
-static void
-configure_platform()
-{
-    try
-    {
-        PlatformConfig config
-        { OC::ServiceType::InProc, ModeType::Server, "0.0.0.0", 0, OC::QualityOfService::LowQos };
-
-        OCPlatform::Configure(config);
-
-        dlog_print(DLOG_INFO, LOG_TAG, "#### Platform configuration done!!!!");
-    }
-    catch (OCException &e)
-    {
-        dlog_print(DLOG_ERROR, LOG_TAG, "Exception occured! (%s)", e.what());
-    }
-}
-
-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 = (appdata_s *)data;
-
-    elm_app_base_scale_set(1.8);
-
-    create_base_gui(ad);
-
-    configure_platform();
-
-    return true;
-}
-
-static void
-app_control(app_control_h app_control, void *data)
-{
-    // Handle the launch request.
-}
-
-static void
-app_pause(void *data)
-{
-    // Take necessary actions when application becomes invisible.
-}
-
-static void
-app_resume(void *data)
-{
-    // Take necessary actions when application becomes visible.
-}
-
-static void
-app_terminate(void *data)
-{
-    // Release all resources.
-}
-
-static void
-ui_app_lang_changed(app_event_info_h event_info, void *user_data)
-{
-    // APP_EVENT_LANGUAGE_CHANGED
-    char *locale = NULL;
-    system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &locale);
-    elm_language_set(locale);
-    free(locale);
-    return;
-}
-
-static void
-ui_app_orient_changed(app_event_info_h event_info, void *user_data)
-{
-    // APP_EVENT_DEVICE_ORIENTATION_CHANGED
-    return;
-}
-
-static void
-ui_app_region_changed(app_event_info_h event_info, void *user_data)
-{
-    // APP_EVENT_REGION_FORMAT_CHANGED
-}
-
-static void
-ui_app_low_battery(app_event_info_h event_info, void *user_data)
-{
-    // APP_EVENT_LOW_BATTERY
-}
-
-static void
-ui_app_low_memory(app_event_info_h event_info, void *user_data)
-{
-    // APP_EVENT_LOW_MEMORY
-}
-
-int
-main(int argc, char *argv[])
-{
-    appdata_s ad = {0,};
-    int ret = 0;
-
-    ui_app_lifecycle_callback_s event_callback = {0,};
-    app_event_handler_h handlers[5] = {NULL, };
-
-    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_LOW_BATTERY], APP_EVENT_LOW_BATTERY,
-                             ui_app_low_battery, &ad);
-    ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY,
-                             ui_app_low_memory, &ad);
-    ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED],
-                             APP_EVENT_DEVICE_ORIENTATION_CHANGED,
-                             ui_app_orient_changed, &ad);
-    ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED],
-                             APP_EVENT_LANGUAGE_CHANGED,
-                             ui_app_lang_changed, &ad);
-    ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED],
-                             APP_EVENT_REGION_FORMAT_CHANGED,
-                             ui_app_region_changed, &ad);
-    ui_app_remove_event_handler(handlers[APP_EVENT_LOW_MEMORY]);
-
-    ret = ui_app_main(argc, argv, &event_callback, &ad);
-    if (APP_ERROR_NONE != ret)
-    {
-        dlog_print(DLOG_ERROR, LOG_TAG, "app_main() is failed. err = %d", ret);
-    }
-    return ret;
-}