[TBT][Non-ACR][DPTTIZEN-2914,Adding Test Case for Motion Detectio APIs] 37/146537/5
authormaneesha <maneesha.k@samsung.com>
Tue, 29 Aug 2017 08:48:35 +0000 (14:18 +0530)
committerNibha Sharma <nibha.sharma@samsung.com>
Mon, 11 Sep 2017 04:07:25 +0000 (04:07 +0000)
Change-Id: I247791d5b36651d45cb92ae982d77eb991b11a0a
Signed-off-by: maneesha <maneesha.k@samsung.com>
12 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/.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 f083fc9..2956119
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 8cfb664..eb1f281
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 77f5bba1e6d7f02bffaf171fb2f09ae19ebfd84f..05ddf0f3465058b50fd1b8c179da2286fc6d771c 100644 (file)
Binary files a/tbtcoreapp/.sdk_delta.info and b/tbtcoreapp/.sdk_delta.info differ
index 3c2d0503f2265e3408138877c27ebab03cb47062..de6c189a87a7aaabf2252b2ffe2797354114a8aa 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,
@@ -243,7 +243,7 @@ typedef enum {
     TBT_APP_D2D_CLIENT,
 
     TBT_APP_D2D_SERVER,
-    
+
     TBT_APP_TTS,
 
     TBT_APP_STT,
@@ -307,7 +307,9 @@ typedef enum {
 
        TBT_APP_DALI_WIDGET,
 
-       TBT_APP_MULTICLASS
+       TBT_APP_MULTICLASS,
+
+       TBT_APP_MOTION_DETECTION
        //TBT_APP_DALI_SCROLL_BAR
 
 } tbt_app_type_e;
@@ -388,7 +390,6 @@ struct _tbt_info
     app_control_h push_app_control;            /**< App conrol handler*/
     int required_features_count;               /**< Number of features required */
     int features_required[16];                 /**< Index/indexs of features required */
-
 };
 
 
@@ -593,7 +594,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;
@@ -804,7 +805,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 7f0339fd7c381bdceabd61d6c90f3b7bc65914ef..3099ada1d46594dab7a43a402a8b96be0feaafbd 100755 (executable)
 //#define TBT_MODULE_APP_DALI_SLIDER
 #define TBT_MODULE_MULTICLASS
 #define TBT_MODULE_APP_MULTICLASS
+#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 fe6c256413360810ceb89b89e36d5409847506e3..31d3af3d91e2c69941d1ad06bd07901d527c8575 100755 (executable)
@@ -2848,6 +2848,21 @@ static tbt_info tbtapps[] =
                        .icon_name = "dummy",
                        .info = "1. Please install multiclass org.example.multiclass tpk file <br/>2. Click View Widget UI button<br/>3.Multiple Widget class app gets launched.<br/>4.Please refer info section",
                        .result = 0
+               },
+       #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 79b4943825f94b232e022403b14613efe608188a..8282ee1bac631bffbac88a669840cd568040b2e4 100755 (executable)
 #include "view/tbt-ui-viewmgr-view.h"
 #include "view/tbt-dali-view.h"
 #include "view/tbt-multiclass-view.h"
-
+#include "view/tbt-motion-detection-view.h"
 typedef struct
 {
        Evas_Object *win;
@@ -456,7 +456,7 @@ static void _gl_longpressed_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNU
 static void _gl_expanded_cb(void *data, Evas_Object *obj, void *event_info)
 {
        RETM_IF(!data, "data is NULL");
-       
+
 
        genlist_view *view;
        view = (genlist_view*)data;
@@ -528,7 +528,6 @@ static void _gl_contracted_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUS
 static void _gl_item_selected_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
 {
        RETM_IF(!data, "data is NULL");
-       
 
        genlist_view *view = NULL;
        view = (genlist_view*)data;
@@ -1246,6 +1245,13 @@ static void _gl_item_selected_cb(void *data, Evas_Object *obj EINA_UNUSED, void
                                multiclass_view_add(view->navi, info, it);
                                break;
                #endif
+               #ifdef TBT_MODULE_MOTION
+                       #ifdef TBT_MODULE_APP_MOTION_DETECTION
+                       case TBT_APP_MOTION_DETECTION:
+                               motion_detection_view_add(view->navi, info, it);
+                               break;
+                       #endif
+               #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..0aaa099
--- /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