[TBT][Non-ACR][DPTTIZEN-2914,Adding Test Case for Motion Detectio APIs] 24/147924/2
authormaneesha <maneesha.k@samsung.com>
Mon, 28 Aug 2017 12:10:20 +0000 (17:40 +0530)
committerJihun Park <jihun87.park@samsung.com>
Mon, 11 Sep 2017 07:08:39 +0000 (07:08 +0000)
Change-Id: I798e6b7eb3e8776fa0d4ea9bde51b8f247c2e00d
Signed-off-by: maneesha <maneesha.k@samsung.com>
13 files changed:
release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk [changed mode: 0755->0644]
release/binary-x86/org.tizen.tbtcoreapp-1.0.0-x86.tpk [changed mode: 0755->0644]
tbtcoreapp/.cproject
tbtcoreapp/.sdk_delta.info
tbtcoreapp/inc/model/tbt-info.h
tbtcoreapp/inc/utils/app_module_config.h
tbtcoreapp/inc/view/tbt-motion-detection-view.h [new file with mode: 0644]
tbtcoreapp/res/edje/3.0/mobile/motion_detection_viewer.edc [new file with mode: 0644]
tbtcoreapp/res/images/Not_Detecting.jpg [new file with mode: 0755]
tbtcoreapp/src/model/tbt-list.c
tbtcoreapp/src/view/tbt-feature-view.c
tbtcoreapp/src/view/tbt-genlist-view.c
tbtcoreapp/src/view/tbt-motion-detection-view.c [new file with mode: 0644]

old mode 100755 (executable)
new mode 100644 (file)
index 8a8f5e1..c3130bf
Binary files a/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk and b/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk differ
old mode 100755 (executable)
new mode 100644 (file)
index fe14916..6c8408c
Binary files a/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-x86.tpk and b/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-x86.tpk differ
index f6b261e691ee1cc870634bf800110eef681a27aa..e79b3f3f191950784f7f8c5a80f25b6f2cd29c04 100644 (file)
                                                                <option id="gnu.cpp.compiler.option.optimization.level.1995167770" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
                                                                <option id="sbi.gnu.cpp.compiler.option.debugging.level.core.1231413559" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level.core" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
                                                                <option id="sbi.gnu.cpp.compiler.option.94795005" name="Tizen-Target" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs">
-                                                                       <listOptionValue builtIn="false" value="mobile-4.0-emulator.core.public.20170531_2_llvm37.i386.core.app"/>
+                                                                       <listOptionValue builtIn="false" value="mobile-4.0-device.core_llvm37.armel.core.app"/>
                                                                </option>
                                                                <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.core.1151584155" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.core" valueType="includePath">
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/libxml2&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/SDL2&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-agent&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appfw&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/asp/&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/notification&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/nsd/&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/phonenumber-utils&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/SDL2&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/sensor&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/service-adaptor&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/shortcut&quot;"/>
                                                                        <listOptionValue builtIn="false" value="${RS_COMPILER_MISC}"/>
                                                                        <listOptionValue builtIn="false" value=" -fPIE"/>
                                                                        <listOptionValue builtIn="false" value="--sysroot=&quot;${SBI_SYSROOT}&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="-mthumb"/>
                                                                </option>
                                                                <option id="gnu.cpp.compiler.option.include.paths.1083200282" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/inc}&quot;"/>
                                                                <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.705018152" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
                                                                <option id="sbi.gnu.c.compiler.option.debugging.level.core.1866251786" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level.core" value="gnu.c.debugging.level.max" valueType="enumerated"/>
                                                                <option id="sbi.gnu.c.compiler.option.828406008" name="Tizen-Target" superClass="sbi.gnu.c.compiler.option" valueType="userObjs">
-                                                                       <listOptionValue builtIn="false" value="mobile-4.0-emulator.core.public.20170531_2_llvm37.i386.core.app"/>
+                                                                       <listOptionValue builtIn="false" value="mobile-4.0-device.core_llvm37.armel.core.app"/>
                                                                </option>
                                                                <option id="sbi.gnu.c.compiler.option.frameworks_inc.core.2054553498" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.c.compiler.option.frameworks_inc.core" valueType="includePath">
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/libxml2&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/SDL2&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-agent&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appfw&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/asp/&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/notification&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/nsd/&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/phonenumber-utils&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/SDL2&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/sensor&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/service-adaptor&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/shortcut&quot;"/>
                                                                        <listOptionValue builtIn="false" value="${RS_COMPILER_MISC}"/>
                                                                        <listOptionValue builtIn="false" value=" -fPIE"/>
                                                                        <listOptionValue builtIn="false" value="--sysroot=&quot;${SBI_SYSROOT}&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="-mthumb"/>
                                                                </option>
                                                                <option id="gnu.c.compiler.option.include.paths.2145246600" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/inc}&quot;"/>
                                                                        <additionalInput kind="additionalinput" paths="$(LIBS)"/>
                                                                </inputType>
                                                        </tool>
-                                                       <tool command="i386-linux-gnueabi-as" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.692653264" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base">
+                                                       <tool command="arm-linux-gnueabi-as" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.692653264" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base">
                                                                <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1386960240" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
                                                        </tool>
                                                        <tool id="org.tizen.nativecore.tool.fnmapgen.2050008912" name="C FN-Map Generator" superClass="org.tizen.nativecore.tool.fnmapgen"/>
index 77f5bba1e6d7f02bffaf171fb2f09ae19ebfd84f..3dbdc8e0124b5b75b759317a62930337d30be58d 100644 (file)
Binary files a/tbtcoreapp/.sdk_delta.info and b/tbtcoreapp/.sdk_delta.info differ
index 3841a301e9493899c90bb94099a420c94f741e6c..613bfe7243099449356470a5faad8e148ed8af21 100755 (executable)
@@ -71,7 +71,7 @@ typedef enum {
     TBT_APP_BT_AVRCP,
     TBT_APP_BT_AG,
     TBT_APP_BT_HDP,
-    
+
     TBT_APP_BLE_GATT_CLIENT,
     TBT_APP_BLE_GATT_SERVER,
 
@@ -160,7 +160,7 @@ typedef enum {
     TBT_APP_EVENT_VIEW,
 
     TBT_APP_FEATURE_SUMMARY,
-       
+
        TBT_APP_AUDIO_JACK,
        TBT_APP_KEY_VIBRATION,
        TBT_APP_BATTERY,
@@ -206,25 +206,25 @@ typedef enum {
     TBT_APP_NSD_SSDP_REMOTE,
 
     TBT_APP_STORAGE,
-       
+
     TBT_APP_RADIO,
-       
+
     TBT_APP_SOUND_MANAGER,
 
     TBT_APP_SOUND_MANAGER_DEVICE,
 
     TBT_APP_MEDIA_KEY,
-       
+
     TBT_APP_PACKAGE_MANAGER,
 
     TBT_APP_NOTIFICATION_TEXT,
-       
+
     TBT_APP_NOTIFICATION_TIME,
 
     TBT_APP_NOTIFICATION_TITLE,
 
     TBT_APP_NOTIFICATION_IMAGE,
-       
+
     TBT_APP_CONNECTION,
 
        TBT_APP_SYSTEM_SETTINGS_FONT,
@@ -309,7 +309,8 @@ typedef enum {
 
        TBT_APP_MULTICLASS,
 
-       TBT_APP_USBHOST
+       TBT_APP_USBHOST,
+       TBT_APP_MOTION_DETECTION
        //TBT_APP_DALI_SCROLL_BAR
 
 } tbt_app_type_e;
@@ -595,7 +596,7 @@ typedef enum
        FEATURE_TIZEN_ORG_SYSTEM_INPUT_KEY_MENU,
        FEATURE_TIZEN_ORG_SYSTEM_INPUT_KEY_BACK,
        FEATURE_FIDO_UAF,
-
+       FEATURE_ACTIVITY_RECOGNITION,
        ALL_FEATURES
 
 }features_e;
@@ -806,7 +807,7 @@ static char* feature_list[1024]=
        [FEATURE_TIZEN_ORG_SYSTEM_INPUT_KEY_MENU] = "tizen.org/system/input.key.menu",
        [FEATURE_TIZEN_ORG_SYSTEM_INPUT_KEY_BACK] = "tizen.org/system/input.key.back",
        [FEATURE_FIDO_UAF] = "tizen.org/feature/fido.uaf",
-
+       [FEATURE_ACTIVITY_RECOGNITION] = "tizen.org/feature/activity_recognition"
 };
 
 #endif /* __TBT_INFO_H__ */
index fa957cd2a4d8dc88b6b1cb278c7bd4717d58f460..b16fbc5018373fbf0cbc4e36c3936a182da5389c 100755 (executable)
 #define TBT_MODULE_APP_MULTICLASS
 #define TBT_MODULE_USBHOST
 #define TBT_MODULE_APP_USBHOST
-
+#define TBT_MODULE_MOTION
+#define TBT_MODULE_APP_MOTION_DETECTION
 #endif
diff --git a/tbtcoreapp/inc/view/tbt-motion-detection-view.h b/tbtcoreapp/inc/view/tbt-motion-detection-view.h
new file mode 100644 (file)
index 0000000..ab9254a
--- /dev/null
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ *  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.
+ *
+ *******************************************************************************/
+/**
+ * @file       tbt-motion-detection-view.h
+ * @brief      Detect motion in device
+ * @since_tizen 3.0
+ * @author     Maneesha Karn (maneesha.k@samsung.com)
+ * @date       August, 2017
+ * @bug                NA
+ * @credit
+ *
+ */
+
+#ifndef __TBT_MOTION_DETECTION_VIEW_H__
+#define __TBT_MOTION_DETECTION_VIEW_H__
+
+#include "utils/app_module_config.h"
+#ifdef TBT_MODULE_MOTION
+
+#include <Evas.h>
+#include "model/tbt-list.h"
+
+#include <activity_recognition.h>
+#include <gesture_recognition.h>
+
+/**
+ * @typedef _motion_detection_view
+ * @since_tizen 4.0
+ * @brief A motion detection handler
+ */
+typedef struct _motion_detection_view motion_detection_view;
+
+/**
+ * @brief Add motion detection view
+ * @since_tizen 3.0
+ * @param[in] app The pointer to _app_data instance
+ * @param[in] navi The naviframe object
+ * @return motion detection view data
+ */
+motion_detection_view *motion_detection_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item);
+
+#endif  //TBT_MODULE_MOTION
+#endif // __TBT_MOTION_DETECTION_VIEW_H__
diff --git a/tbtcoreapp/res/edje/3.0/mobile/motion_detection_viewer.edc b/tbtcoreapp/res/edje/3.0/mobile/motion_detection_viewer.edc
new file mode 100644 (file)
index 0000000..4483058
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd 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.
+ */
+
+#define TEXT_HEIGHT 0.08
+#define CONTENT_X_PAD 0.15
+
+collections
+{
+   base_scale: 1.8;
+   group
+   {
+      name: "motion_detection_viewer";
+      parts{
+         part{
+            name: "activity_text";
+            type: SWALLOW;
+            description{
+               state: "default" 0.0;
+               align: 0.0 0.0;
+               visible: 1;
+               rel1 {relative: 0.0 0.0; }
+               rel2 {relative: 1.0 TEXT_HEIGHT; }
+            }
+         }
+
+         part{
+            name: "activity_image";
+            type: SWALLOW;
+            description{
+               state: "default" 0.0;
+               align: 0.5 0.5;
+               max : 400 400;
+               min : 400 400;
+               visible: 1;
+               rel1{
+                  relative: 1.0 1.0;
+                  to_y: "activity_text";
+               }
+               rel2{
+                  relative: 0.0 0.80;
+               }
+            }
+         }
+         part{
+            name: "controlr_part";
+            type: SWALLOW;
+            description {
+               state: "default" 0.0;
+               align : 0 0.5;
+               rel1 {
+                  relative: 0.0 1.0;
+                  to_y: "activity_image";
+               }
+               rel2 {
+                  relative: 1.0 1.0;
+               }
+               visible: 1;
+            }//Ending description
+         }//Ending part
+      }//Ending parts
+   }//Ending group
+}//Ending collections
diff --git a/tbtcoreapp/res/images/Not_Detecting.jpg b/tbtcoreapp/res/images/Not_Detecting.jpg
new file mode 100755 (executable)
index 0000000..8b28cfb
Binary files /dev/null and b/tbtcoreapp/res/images/Not_Detecting.jpg differ
index 216a2489d54faa9cd01f783a4938eb2c706d6aaf..bb26a7b9ba570cfee3c72ee7fb4fe59ee1477074 100755 (executable)
@@ -2865,6 +2865,22 @@ static tbt_info tbtapps[] =
                        .result = 0,
                        .required_features_count = 1,
                        .features_required = { FEATURE_USB_HOST }
+               },
+       #endif
+#endif
+
+#ifdef TBT_MODULE_MOTION
+       #ifdef TBT_MODULE_APP_MOTION_DETECTION
+               {
+                       .name = "Motion Detection",
+                       .parent = "Motion",
+                       .apptype = TBT_APP_MOTION_DETECTION,
+                       .icon_name = "dummy",
+                       .file_name = "images/Not_Detecting.jpg",
+                       .info = "1.Please press Start Detection <br/>2. Perform corresponding activity with phone in hand(Stationary, Walk, Run and In Vehicle <br/>3. Once done press Stop Detection <br/>4. If All Activities are indicated on the label then Test Case Pass else Fail",
+                       .result = 0,
+                       .required_features_count = 1,
+                       .features_required = {FEATURE_ACTIVITY_RECOGNITION}
                }
        #endif
 #endif
index a186bc25af8616cd41d73d8c933093d20f03b95b..ec4d74a9843fe5a60d9a7f4bd12f5e41a1bf822f 100644 (file)
@@ -175,7 +175,8 @@ static void feature_summary_list_prepare(feature_view *this)
                                "tizen.org/feature/vision.face_recognition",
                                "tizen.org/feature/vision.image_recognition",
                                "tizen.org/feature/vision.qrcode_generation",
-                               "tizen.org/feature/vision.qrcode_recognition"};
+                               "tizen.org/feature/vision.qrcode_recognition",
+                               "tizen.org/feature/activity_recognition"};
 
        char chResult[1000];
        int i;
index bb64d8eb1ce3383cc294173bc80ffcab830e5c61..22da5641c6d349079903aaa5b7138b543e6271a0 100755 (executable)
 #include "view/tbt-dali-view.h"
 #include "view/tbt-multiclass-view.h"
 #include "view/tbt-usb-host-view.h"
-
+#include "view/tbt-motion-detection-view.h"
 typedef struct
 {
        Evas_Object *win;
@@ -1261,6 +1261,11 @@ static void _gl_item_selected_cb(void *data, Evas_Object *obj EINA_UNUSED, void
                                usbhost_view_add(view->navi, info, it);
                        break;
                #endif
+               #ifdef TBT_MODULE_MOTION
+                       case TBT_APP_MOTION_DETECTION:
+                               motion_detection_view_add(view->navi, info, it);
+                               break;
+               #endif
                default:
                        assert(false);
                        break;
diff --git a/tbtcoreapp/src/view/tbt-motion-detection-view.c b/tbtcoreapp/src/view/tbt-motion-detection-view.c
new file mode 100644 (file)
index 0000000..4445408
--- /dev/null
@@ -0,0 +1,330 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ *  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.
+ *******************************************************************************/
+/**
+ * @file       tbt-motion-detection-view.c
+ * @brief      shows motion detected and indicates the same on display
+ *
+ * @author     Maneesha Karn (maneesha.k@samsung.com)
+ * @date       August, 2017
+ * @bug                no known bug
+ * @credit
+ *
+ */
+
+#include "utils/app_module_config.h"
+#ifdef TBT_MODULE_MOTION
+
+#include <Elementary.h>
+
+#include "utils/logger.h"
+#include "utils/config.h"
+#include "utils/ui-utils.h"
+#include "view/tbt-motion-detection-view.h"
+#include "view/tbt-common-view.h"
+
+
+enum
+{
+    ACTIVITY_TOOLBAR_ITEM_INDEX_STATIONARY = 0,
+    ACTIVITY_TOOLBAR_ITEM_INDEX_WALK,
+    ACTIVITY_TOOLBAR_ITEM_INDEX_RUN,
+    ACTIVITY_TOOLBAR_ITEM_INDEX_IN_VEHICLE,
+    ACTIVITY_TOOLBAR_ITEM_INDEX_COUNT_MAX
+} ACTIVITY_TOOLBAR_ITEM_INDEXS;
+
+
+struct _motion_detection_view
+{
+    common_view* view;
+    activity_h handle;
+    Evas_Object *start_detection_button;
+    Evas_Object *stop_detection_button;
+    Evas_Object *activity_image;
+    Evas_Object *activity_label;
+};
+
+static void _app_destroy_cb(void* this);
+static void _start_detection_button_pressed_cb(void *data, Evas_Object *obj, void *event_info);
+static void _stop_detection_button_pressed_cb(void *data, Evas_Object *obj, void *event_info);
+static char * _motion_get_activity_type(activity_type_e activity_type);
+static Evas_Object *add_control_layout(motion_detection_view *this, Evas_Object *parent);
+static void activity_recognition_callback_check_type(activity_type_e activity, const activity_data_h data, double timestamp, activity_error_e error, void *user_data);
+static char *_activity_error(int activity_error);
+
+
+/**
+ * @function           motion_detection_view_add
+ * @since_tizen                2.3
+ * @description                Motion Detection View Add
+ * @parameter          Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer
+ * @return                     motion_detection_view*
+ */
+motion_detection_view *motion_detection_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item)
+{
+    RETVM_IF(NULL == navi, NULL, "navi is null");
+
+    int x,y,w,h;
+    evas_object_geometry_get(navi, &x, &y, &w, &h);
+    DBG("Dim: %d %d %d %d", x, y, w, h);
+
+    motion_detection_view *this = NULL;
+    this = calloc(1, sizeof(motion_detection_view));
+    RETVM_IF(!this, NULL, "calloc failed");
+
+    this->view = calloc(1, sizeof(common_view));
+    RETVM_IF(!this->view, NULL, "calloc failed");
+
+    tbt_info->layout_group = "motion_detection_viewer";
+    tbt_info->layout_file = get_edje_path("motion_detection_viewer.edj");
+
+    common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this);
+
+    RETVM_IF(NULL == this->view, NULL, "navi is null");
+
+    this->activity_label = ui_utils_label_add(this->view->layout, "Activity Status");
+    RETVM_IF(NULL == this->activity_label, NULL, "Label is null");
+
+    elm_object_part_content_set(this->view->layout, "activity_text", this->activity_label);
+    ui_utils_label_set_text(this->activity_label, "Activity Status", "left");
+    const char *file_path;
+    file_path = get_resource_path(this->view->tbt_info->file_name);
+    this->activity_image = ui_utils_create_image(this->view->layout, file_path);
+
+    //int x,y,w,h;
+    evas_object_geometry_get(this->activity_image, &x, &y, &w, &h);
+    DBG("Dim: %d %d %d %d", x, y, w, h);
+
+    RETVM_IF(NULL == this->activity_image, false, "creation of layout elements failed");
+
+    elm_object_part_content_set(this->view->layout, "activity_image", this->activity_image);
+
+    Evas_Object *control = add_control_layout(this, this->view->layout);
+    elm_object_part_content_set(this->view->layout, "controlr_part", control);
+    evas_object_show(control);
+    return this;
+}
+
+
+
+
+/**
+ * @function           _activity_error
+ * @since_tizen                3.0
+ * @description                Return string name of Activity Error detected
+ * @parameter          int activity_error
+ * @return                     static char *
+ */
+static char *_activity_error(int activity_error)
+{
+       char error[50];
+       switch(activity_error)
+       {
+       case ACTIVITY_ERROR_ALREADY_STARTED :
+               strcpy(error,"ACTIVITY_ERROR_ALREADY_STARTED");
+               break;
+       case ACTIVITY_ERROR_INVALID_OPERATION:
+               strcpy(error,"ACTIVITY_ERROR_INVALID_OPERATION");
+               break;
+       case ACTIVITY_ERROR_INVALID_PARAMETER:
+               strcpy(error,"ACTIVITY_ERROR_INVALID_PARAMETER");
+               break;
+       case ACTIVITY_ERROR_NOT_STARTED :
+               strcpy(error,"ACTIVITY_ERROR_NOT_STARTED");
+               break;
+       case ACTIVITY_ERROR_NOT_SUPPORTED :
+               strcpy(error,"ACTIVITY_ERROR_NOT_SUPPORTED");
+               break;
+       case ACTIVITY_ERROR_OPERATION_FAILED:
+               strcpy(error,"ACTIVITY_ERROR_OPERATION_FAILED");
+               break;
+       case ACTIVITY_ERROR_OUT_OF_MEMORY:
+               strcpy(error,"ACTIVITY_ERROR_OUT_OF_MEMORY");
+               break;
+       case ACTIVITY_ERROR_PERMISSION_DENIED:
+               strcpy(error,"ACTIVITY_ERROR_PERMISSION_DENIED");
+               break;
+       default:
+               strcpy(error, "Unrecognized Error");
+       }
+       return strdup(error);
+       }
+
+
+
+/**
+ * @function           _motion_get_activity_type
+ * @since_tizen                3.0
+ * @description                Return string name of Activity detected
+ * @parameter          activity_type_e activity_type
+ * @return                     static char *
+ */
+static char * _motion_get_activity_type(activity_type_e activity_type)
+{
+       DBG("_motion_get_activity_type");
+       const int LEN = 100;
+       char string[LEN];
+       switch(activity_type)
+       {
+       case ACTIVITY_STATIONARY :
+               snprintf(string, LEN, "Activity Stationary");
+               DBG("ACTIVITY_STATIONARY ");
+               break;
+       case ACTIVITY_WALK:
+               snprintf(string, LEN, "Activity is Walking");
+               DBG("ACTIVITY_WALK");
+               break;
+       case ACTIVITY_RUN:
+               snprintf(string, LEN, "Activity is Running");
+               DBG("ACTIVITY_RUN");
+               break;
+       case ACTIVITY_IN_VEHICLE :
+               snprintf(string, LEN, "Activity is In Vehicle");
+               DBG("ACTIVITY_IN_VEHICLE ");
+               break;
+       default :
+               snprintf(string, LEN, "Unrecognized Activity");
+               DBG("Unrecognized Activity");
+       }
+       return strdup(string);
+}
+
+
+/**
+ * @function           _start_detection_button_pressed_cb
+ * @since_tizen                3.0
+ * @description                Callback called when an activity is detected
+ * @parameter          void
+ * @return                     void *data, Evas_Object *obj, void *event_info
+ */
+static void _start_detection_button_pressed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       DBG(" start_detection_button_pressed_cb ");
+
+       RETM_IF(NULL == data, "data is NULL");
+
+       motion_detection_view *this = NULL;
+       this = (motion_detection_view*)data;
+       RETM_IF(NULL == this, "view is NULL");
+       activity_type_e activity_type = ACTIVITY_STATIONARY;
+
+       int nRet = activity_start_recognition(this->handle, activity_type, activity_recognition_callback_check_type, this);
+
+       if(nRet != ACTIVITY_ERROR_NONE)
+       {
+               this->view->tbt_info->result = TBT_INFO_RESULT_NOT_SUPPORTED;
+               elm_genlist_item_update(this->view->item);
+               elm_naviframe_item_pop(this->view->navi);
+               activity_stop_recognition(this->handle);
+               activity_release(this->handle);
+               RETM_IF(nRet != ACTIVITY_ERROR_NONE, "activity_start_recognition failed for activity type = %s",_motion_get_activity_type(activity_type));
+       }
+}
+
+
+
+/**
+ * @function           activity_recognition_callback_check_type
+ * @since_tizen                3.0
+ * @description                To Check the activity type
+ * @parameter          void
+ * @return                     activity_type_e activity, const activity_data_h data, double timestamp, activity_error_e error, void *user_data
+ */
+static void activity_recognition_callback_check_type(activity_type_e activity, const activity_data_h data, double timestamp, activity_error_e error, void *user_data)
+{
+       char label[200]={'\0'};
+       DBG("activity_recognition_callback_check_type");
+       RETM_IF(NULL == user_data, "User data is NULL");
+       motion_detection_view *this = (motion_detection_view*)user_data;
+       snprintf(label, sizeof(label), "%s : %s" , "Activity Status is : ", _motion_get_activity_type(activity));
+       ui_utils_label_set_text(this->activity_label, label,  "left");
+       return;
+}
+
+
+
+/**
+ * @function           _stop_detection_button_pressed_cb
+ * @since_tizen                3.0
+ * @description                To handle stop detection button pressed event
+ * @parameter          void
+ * @return                     void *data, Evas_Object *obj, void *event_info
+ */
+
+
+static void _stop_detection_button_pressed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       DBG(" _stop_detection_button_pressed_cb ");
+       RETM_IF(NULL == data, "data is NULL");
+       motion_detection_view *this = NULL;
+       this = (motion_detection_view*)data;
+       RETM_IF(NULL == this, "view is NULL");
+       activity_stop_recognition(this->handle);
+       activity_release(this->handle);
+}
+
+
+/**
+ * @function           add_control_layout
+ * @since_tizen                3.0
+ * @description                To add buttons to the view
+ * @parameter          void
+ * @return                     motion_detection_view *this, Evas_Object *parent
+ */
+
+static Evas_Object *add_control_layout(motion_detection_view *this, Evas_Object *parent)
+{
+       DBG("add_control_layout__");
+
+       RETVM_IF(NULL == this,  NULL, "view is NULL");
+       RETVM_IF(NULL == parent, NULL, "parent is NULL");
+
+    Evas_Object *table = elm_table_add(parent);
+
+    evas_object_size_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+    evas_object_size_hint_align_set(table, EVAS_HINT_FILL, EVAS_HINT_FILL);
+    evas_object_show(table);
+
+    this->start_detection_button = ui_utils_push_button_add(this, table, "Start Detection", _start_detection_button_pressed_cb);
+    RETVM_IF(NULL == this->start_detection_button, NULL,  "this->start_detection_button is NULL");
+    elm_table_pack(table, this->start_detection_button, 0, 0, 1, 1);
+    this->stop_detection_button= ui_utils_push_button_add(this, table, "Stop Detection", _stop_detection_button_pressed_cb);
+    RETVM_IF(NULL == this->stop_detection_button, NULL, "this->stop_detection_button is NULL");
+    elm_table_pack(table, this->stop_detection_button, 1, 0, 1, 1);
+
+    return table;
+}
+
+
+/**
+ * @function           _app_destroy_cb
+ * @since_tizen                2.3
+ * @description                 App Destroy Cb
+ * @parameter          void*: Void Pointer
+ * @return             static void
+ */
+static void _app_destroy_cb(void* this)
+{
+       RETM_IF(NULL == this, "data is NULL");
+
+       motion_detection_view *view = NULL;
+       view = (motion_detection_view*)this;
+       RETM_IF(NULL == view, "view is NULL");
+
+       SAFE_DELETE(view->view);
+       SAFE_DELETE(view);
+}
+
+#endif