From 0fbef06d98eb3ec4e00b25110704ef4398f3359c Mon Sep 17 00:00:00 2001 From: Lukasz Bardeli Date: Thu, 25 May 2017 13:19:23 +0200 Subject: [PATCH] [HAM] Adjust html to new standards Change-Id: Ifcb9f9f1f0f9a16b42df5138f32ab3b551bcbab5 Signed-off-by: Lukasz Bardeli --- .../mobile/tizen/humanactivitymonitor.html | 643 ++++++++++++++++++--- .../wearable/tizen/humanactivitymonitor.html | 639 +++++++++++++++++--- 2 files changed, 1107 insertions(+), 175 deletions(-) diff --git a/org.tizen.web.apireference/html/device_api/mobile/tizen/humanactivitymonitor.html b/org.tizen.web.apireference/html/device_api/mobile/tizen/humanactivitymonitor.html index 035c244..b44a3a7 100644 --- a/org.tizen.web.apireference/html/device_api/mobile/tizen/humanactivitymonitor.html +++ b/org.tizen.web.apireference/html/device_api/mobile/tizen/humanactivitymonitor.html @@ -23,8 +23,16 @@ Set up callbacks for data change notification Get current human activity monitor data
  • Record and read human activity data
  • +
  • +Recognize activities and gestures
  • +The gesture recognition API allows applications to be notified and react when the user performs different types of gestures, for example, when the device was tapped, shaken up, picked up or moved along axis. +

    +

    +The activity recognition API allows applications to be notified and react when a user activity is recognized, for example, the user starts to run, walk or is in moving vehicle. +

    +

    For more information about how to use Human Activity Monitor API, see Human Activity Monitor Guide.

    @@ -35,7 +43,7 @@ For more information about how to use Human Activity Monitor API, see
  • 1. Type Definitions
  • 2. Interfaces
  • @@ -130,6 +148,9 @@ For more information about how to use Human Activity Monitor API, see startRecorder (HumanActivityRecorderType type, optional HumanActivityRecorderOption option)
    void stopRecorder (HumanActivityRecorderType type)
    void readRecorderData (HumanActivityRecorderType type, HumanActivityRecorderQuery? query, HumanActivityReadRecorderSuccessCallback successCallback, optional ErrorCallback? errorCallback)
    +
    boolean isGestureSupported (GestureType type)
    +
    long addGestureRecognitionListener (GestureType type, GestureRecognitionCallback listener, optional ErrorCallback? errorCallback, optional boolean? alwaysOn)
    +
    void removeGestureRecognitionListener (long watchId)
    @@ -201,6 +222,10 @@ For more information about how to use Human Activity Monitor API, see GestureData + + + HumanActivityMonitorSuccessCallback
    void onsuccess (optional HumanActivityData? humanactivitydata)
    @@ -208,15 +233,22 @@ For more information about how to use Human Activity Monitor API, see HumanActivityReadRecorderSuccessCallback
    void onsuccess (HumanActivityRecorderData[] humanactivitydata)
    + +GestureRecognitionCallback +
    void onsuccess (GestureData data)
    +

    1. Type Definitions

    -
    +

    1.1. HumanActivityType

    Specifies the supported human activity monitor types.
    +

    Deprecated. + WRIST_UP is deprecated since Tizen 4.0. Use GestureType and addGestureRecognitionListener to monitor WRIST_UP gesture. +

        enum HumanActivityType { "PEDOMETER", "WRIST_UP", "HRM", "GPS", "SLEEP_MONITOR" };

    Since: @@ -369,8 +401,8 @@ UNKNOWN - Sleep status could not be determined

    Code example:

     function onchangedCB(sleepInfo)
     {
    -   console.log("Sleep status: " + sleepInfo.status);
    -   console.log("Timestamp: " + sleepInfo.timestamp);
    +  console.log("Sleep status: " + sleepInfo.status);
    +  console.log("Timestamp: " + sleepInfo.timestamp);
     }
     
     tizen.humanactivitymonitor.start("SLEEP_MONITOR", onchangedCB);
    @@ -382,6 +414,74 @@ tizen.humanactivitymonitor.start("SLEEP_MONITOR", onchangedCB);
      
    +
    +

    1.7. GestureType

    +
    + Specifies the gesture types. +
    +
        enum GestureType { "GESTURE_DOUBLE_TAP", "GESTURE_MOVE_TO_EAR", "GESTURE_NO_MOVE", "GESTURE_PICK_UP",
    +                       "GESTURE_SHAKE", "GESTURE_SNAP", "GESTURE_TILT", "GESTURE_TURN_FACE_DOWN", "GESTURE_WRIST_UP" };
    +

    + Since: + 4.0 +

    +
    +
      +
    • +GESTURE_DOUBLE_TAP - The display of the mobile device is tapped twice
    • +
    • +GESTURE_MOVE_TO_EAR - The mobile device is moved near to an ear
    • +
    • +GESTURE_NO_MOVE - The mobile device is being stopped for a while
    • +
    • +GESTURE_PICK_UP - The mobile device is picked up
    • +
    • +GESTURE_SHAKE - The mobile device is quickly moved back and forth
    • +
    • +GESTURE_SNAP - The mobile device is moved along an axis and back
    • +
    • +GESTURE_TILT - The mobile device is tilted
    • +
    • +GESTURE_TURN_FACE_DOWN - The mobile device is flipped from face to back
    • +
    • +GESTURE_WRIST_UP - The wearable device is moved and faced up
    • +
    +
    +
    +
    +

    1.8. GestureEvent

    +
    + Specifies the gesture events. +
    +
        enum GestureEvent { "GESTURE_EVENT_DETECTED", "GESTURE_SHAKE_DETECTED", "GESTURE_SHAKE_FINISHED", "GESTURE_SNAP_X_NEGATIVE",
    +                        "GESTURE_SNAP_X_POSITIVE", "GESTURE_SNAP_Y_NEGATIVE", "GESTURE_SNAP_Y_POSITIVE", "GESTURE_SNAP_Z_NEGATIVE", "GESTURE_SNAP_Z_POSITIVE" };
    +

    + Since: + 4.0 +

    +
    +
      +
    • +GESTURE_EVENT_DETECTED - The gesture is detected
    • +
    • +GESTURE_SHAKE_DETECTED - Shake gesture is detected
    • +
    • +GESTURE_SHAKE_FINISHED - Shake gesture is finished
    • +
    • +GESTURE_SNAP_X_NEGATIVE - [-X] snap is detected
    • +
    • +GESTURE_SNAP_X_POSITIVE - [+X] snap is detected
    • +
    • +GESTURE_SNAP_Y_NEGATIVE - [-Y] snap is detected
    • +
    • +GESTURE_SNAP_Y_POSITIVE - [+Y] snap is detected
    • +
    • +GESTURE_SNAP_Z_NEGATIVE - [-Z] snap is detected
    • +
    • +GESTURE_SNAP_Z_POSITIVE - [+Z] snap is detected
    • +
    +
    +

    2. Interfaces

    @@ -430,6 +530,10 @@ The tizen.humanactivitymonitor object allows access to the human activi HumanActivityRecorderQuery? query, HumanActivityReadRecorderSuccessCallback successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException); + + boolean isGestureSupported(GestureType type) raises(WebAPIException); + long addGestureRecognitionListener(GestureType type, GestureRecognitionCallback listener, optional ErrorCallback? errorCallback, optional boolean? alwaysOn) raises(WebAPIException); + void removeGestureRecognitionListener(long watchId) raises(WebAPIException); };

    Since: @@ -516,20 +620,20 @@ The ErrorCallback method is launched with these error types:

    Code example:

     function onsuccessCB(pedometerInfo)
     {
    -   console.log("Step status: " + pedometerInfo.stepStatus);
    -   console.log("Cumulative total step count: " + pedometerInfo.cumulativeTotalStepCount);
    +  console.log("Step status: " + pedometerInfo.stepStatus);
    +  console.log("Cumulative total step count: " + pedometerInfo.cumulativeTotalStepCount);
     }
     
     function onerrorCB(error)
     {
    -   console.log("Error occurs. name:" + error.name + ", message: " + error.message);
    +  console.log("Error occurs. name:" + error.name + ", message: " + error.message);
     }
     
     function onchangedCB(pedometerdata)
     {
    -   console.log("From now on, you will be notified when the pedometer data changes.");
    -   /* To get the current data information */
    -   tizen.humanactivitymonitor.getHumanActivityData("PEDOMETER", onsuccessCB, onerrorCB);
    +  console.log("From now on, you will be notified when the pedometer data changes.");
    +  /* To get the current data information */
    +  tizen.humanactivitymonitor.getHumanActivityData("PEDOMETER", onsuccessCB, onerrorCB);
     }
     
     tizen.humanactivitymonitor.start("PEDOMETER", onchangedCB);
    @@ -635,8 +739,8 @@ For other types, only 'http://tizen.org/privilege/healthinfo' should be d
     

    Code example:

     function onchangedCB(pedometerInfo)
     {
    -   console.log("Step status: " + pedometerInfo.stepStatus);
    -   console.log("Cumulative total step count: " + pedometerInfo.cumulativeTotalStepCount);
    +  console.log("Step status: " + pedometerInfo.stepStatus);
    +  console.log("Cumulative total step count: " + pedometerInfo.cumulativeTotalStepCount);
     }
     
     tizen.humanactivitymonitor.start("PEDOMETER", onchangedCB);
    @@ -651,26 +755,27 @@ tizen.humanactivitymonitor.start("PEDOMETER", onchangedCB);
     

    Code example:

     function onchangedCB(info)
     {
    -   var gpsInfo = info.gpsInfo;
    -   for (var index = 0; index < gpsInfo.length; index++)
    -   {
    -      console.log("latitude: " + gpsInfo[index].latitude);
    -      console.log("longitude: " + gpsInfo[index].longitude);
    -   }
    +  var gpsInfo = info.gpsInfo;
    +  for (var index = 0; index < gpsInfo.length; index++)
    +  {
    +    console.log("latitude: " + gpsInfo[index].latitude);
    +    console.log("longitude: " + gpsInfo[index].longitude);
    +  }
     }
     
     function onerrorCB(error)
     {
    -   console.log("Error occurred. Name:" + error.name + ", message: " + error.message);
    +  console.log("Error occurred. Name:" + error.name + ", message: " + error.message);
     }
     
     try
     {
    -   tizen.humanactivitymonitor.start("GPS", onchangedCB, onerrorCB, {callbackInterval: 150000, sampleInterval: 1000});
    +  tizen.humanactivitymonitor.start("GPS", onchangedCB, onerrorCB,
    +                                   {callbackInterval: 150000, sampleInterval: 1000});
     }
     catch (err)
     {
    -   console.log(err.name + ": " + err.message);
    +  console.log(err.name + ": " + err.message);
     }
     
    @@ -797,8 +902,8 @@ Note that the setAccumulativePedometerListener() method does not need to call th

    Code example:

     function onchangedCB(pedometerInfo)
     {
    -   console.log("Step status: " + pedometerInfo.stepStatus);
    -   console.log("Accumulative total step count: " + pedometerInfo.accumulativeTotalStepCount);
    +  console.log("Step status: " + pedometerInfo.stepStatus);
    +  console.log("Accumulative total step count: " + pedometerInfo.accumulativeTotalStepCount);
     }
     
     tizen.humanactivitymonitor.setAccumulativePedometerListener(onchangedCB);
    @@ -844,7 +949,8 @@ tizen.humanactivitymonitor.setAccumulativePedometerListener(onchangedCB);
     
             
     
    -

    Code example:

    tizen.humanactivitymonitor.unsetAccumulativePedometerListener();
    +

    Code example:

    +tizen.humanactivitymonitor.unsetAccumulativePedometerListener();
     
    @@ -907,23 +1013,23 @@ The ErrorCallback method is launched with this error type:

    Code example:

     function errorCallback(error)
     {
    -   console.log(error.name + ': ' + error.message);
    +  console.log(error.name + ": " + error.message);
     }
     
     function listener(info)
     {
    -   console.log('type: ' + info.type);
    -   console.log('timestamp: ' + info.timestamp);
    -   console.log('accuracy: ' + info.accuracy);
    +  console.log("type: "      + info.type);
    +  console.log("timestamp: " + info.timestamp);
    +  console.log("accuracy: "  + info.accuracy);
     }
     
     try
     {
    -   var listenerId = tizen.humanactivitymonitor.addActivityRecognitionListener("WALKING", listener, errorCallback);
    +  var listenerId = tizen.humanactivitymonitor.addActivityRecognitionListener("WALKING", listener, errorCallback);
     }
     catch (error)
     {
    -   console.log(error.name + ': ' + error.message);
    +  console.log(error.name + ": " + error.message);
     }
     
    @@ -975,25 +1081,25 @@ var listenerId; function errorCallback(error) { - console.log(error.name + ': ' + error.message); + console.log(error.name + ": " + error.message); } function listener(info) { - console.log('type: ' + info.type); - console.log('timestamp: ' + info.timestamp); - console.log('accuracy: ' + info.accuracy); + console.log("type: " + info.type); + console.log("timestamp: " + info.timestamp); + console.log("accuracy: " + info.accuracy); - tizen.humanactivitymonitor.removeActivityRecognitionListener(listenerId, errorCallback); + tizen.humanactivitymonitor.removeActivityRecognitionListener(listenerId, errorCallback); } try { - listenerId = tizen.humanactivitymonitor.addActivityRecognitionListener("WALKING", listener, errorCallback); + listenerId = tizen.humanactivitymonitor.addActivityRecognitionListener("WALKING", listener, errorCallback); } catch (error) { - console.log(error.name + ': ' + error.message); + console.log(error.name + ": " + error.message); }
    @@ -1054,6 +1160,9 @@ catch (error) with error type AbortError, if the system operation was aborted.

  • + with error type ServiceNotAvailableError, if the human activity recorder type is already started by any application of a package. +

  • +
  • with error type InvalidValuesError, if any of the input parameters contain an invalid value.

  • @@ -1061,18 +1170,19 @@ catch (error)

    Code example:

    -var type = 'PRESSURE';
    +var type = "PRESSURE";
     var options =
     {
    -   retentionPeriod: 1 /* 1 hour */
    +  retentionPeriod: 1 /* 1 hour */
     };
    +
     try
     {
    -   tizen.humanactivitymonitor.startRecorder(type, options);
    +  tizen.humanactivitymonitor.startRecorder(type, options);
     }
     catch (err)
     {
    -   console.log(err.name + ': ' + err.message);
    +  console.log(err.name + ": " + err.message);
     }
     
    @@ -1116,18 +1226,17 @@ catch (err)

    Code example:

    -var type = 'PRESSURE';
    +var type = "PRESSURE";
     try
     {
    -   tizen.humanactivitymonitor.startRecorder(type);
    +  tizen.humanactivitymonitor.startRecorder(type);
    +  /* Do something */
     
    -   /* Do something */
    -
    -   tizen.humanactivitymonitor.stopRecorder(type);
    +  tizen.humanactivitymonitor.stopRecorder(type);
     }
     catch (err)
     {
    -   console.log(err.name + ': ' + err.message);
    +  console.log(err.name + ": " + err.message);
     }
     
    @@ -1214,28 +1323,28 @@ NotFoundError: If no recorder data is available.

    Code example:

     function onerror(error)
     {
    -   console.log(error.name + ": " + error.message);
    +  console.log(error.name + ": " + error.message);
     }
     
     function onread(data)
     {
    -   for (var idx = 0; idx < data.length; ++idx)
    -   {
    -      console.log('startTime: ' + data[idx].startTime);
    -      console.log('endTime: ' + data[idx].endTime);
    -      console.log('calories: ' + data[idx].calorie);
    -   }
    +  for (var idx = 0; idx < data.length; ++idx)
    +  {
    +    console.log("startTime: " + data[idx].startTime);
    +    console.log("endTime: " + data[idx].endTime);
    +    console.log("calories: " + data[idx].calorie);
    +  }
     }
     
    -var type = 'PEDOMETER';
    +var type = "PEDOMETER";
     var query = {};
     try
     {
    -   tizen.humanactivitymonitor.readRecorderData(type, query, onread, onerror);
    +  tizen.humanactivitymonitor.readRecorderData(type, query, onread, onerror);
     }
     catch (err)
     {
    -   console.log(err.name + ': ' + err.message);
    +  console.log(err.name + ": " + err.message);
     }
     
    @@ -1246,6 +1355,216 @@ catch (err) +
    +isGestureSupported +
    +
    +
    + Checks if gesture type is supported on a device. +
    +
    boolean isGestureSupported(GestureType type);
    +             
    +

    + Since: + 4.0 +

    +
    +

    +This function allows to check whether a gesture type is supported on the current device. Some gestures may not be supported on some devices because of lack necessary sensors. +

    +
    +
    +

    Parameters:

    +
      +
    • +type: + Gesture type to check if it is supported on a device. +
    • +
    +
    +
    +

    Return value:

    + boolean true if the given gesture type is supported. +
    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + with error type TypeMismatchError, if input parameter is not compatible with the expected type. +

      • +
      • + with error type AbortError, if any error occurs. +

      • +
      +
    +
    +
    +

    Code example:

    +try
    +{
    +  var isSupported = tizen.humanactivitymonitor.isGestureSupported("GESTURE_PICK_UP");
    +  console.log("GESTURE_PICK_UP is " + (isSupported ? "supported" : "not supported"));
    +}
    +catch (error)
    +{
    +  console.log("Error " + error.name + ": " + error.message);
    +}
    +
    +
    +
    +

    Output example:

     GESTURE_PICK_UP is supported.
    + 
    +
    +
    +
    +addGestureRecognitionListener +
    +
    +
    + Adds a listener to be invoked when given gesture type is detected. +
    +
    long addGestureRecognitionListener(GestureType type, GestureRecognitionCallback listener, optional ErrorCallback? errorCallback, optional boolean? alwaysOn);
    +             
    +

    + Since: + 4.0 +

    +
    +

    +The ErrorCallback method is launched with this error type: +

    +
      +
    • + AbortError : If the system operation was aborted.
    • +
    +
    +
    +

    Parameters:

    +
      +
    • +type: + The gesture type to be monitored. +
    • +
    • +listener: + Listener to be called when gesture is detected or an error occurred. +
    • +
    • +errorCallback [optional] [nullable]: + Callback method to be invoked when an error occurs. +
    • +
    • +alwaysOn [optional] [nullable]: + The option of the monitored gesture mode. If it is set to false system may try to reduce power consumption, for example by stoping detecting gestures when display is turned off.
      If it is set to true power-saving functionality is off. Default value is false. +
    • +
    +
    +
    +

    Return value:

    + long The watch ID used to remove the listener. +
    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter. +

      • +
      • + with error type NotSupportedError, if the gesture recognition is not supported. +

      • +
      • + with error type IOError, if adding listener failed. +

      • +
      +
    +
    +
    +

    Code example:

    +function listener(data)
    +{
    +  console.log("Received " + data.event + " event on " + new Date(data.timestamp * 1000) + " for " + data.type + " type");
    +}
    +
    +function errorCallback(error)
    +{
    +  console.log(error.name + ": " + error.message);
    +}
    +
    +try
    +{
    +  var listenerId = tizen.humanactivitymonitor.addGestureRecognitionListener("GESTURE_SHAKE", listener, errorCallback, true);
    +  console.log("Listener with id " + listenerId + " has been added");
    +}
    +catch (error)
    +{
    +  console.log("Error " + error.name + ": " + error.message);
    +}
    +
    +
    +
    +

    Output example:

     Listener with id 1 has been added
    + Received GESTURE_SHAKE_DETECTED event on Thu Sep 01 2016 14:33:56 GMT+0200 (CEST) for GESTURE_SHAKE type
    + 
    +
    +
    +
    +removeGestureRecognitionListener +
    +
    +
    + Removes listener with the given id. +
    +
    void removeGestureRecognitionListener(long watchId);
    +             
    +

    + Since: + 4.0 +

    +
    +

    Parameters:

    +
      +
    • +watchId: + The ID of the registered listener. +
    • +
    +
    +
    +

    Exceptions:

    +
    • WebAPIException
      • + with error type AbortError, if system error occurs while removing listener. +

      +
    +
    +
    +

    Code example:

    +function listener(data)
    +{
    +  console.log("Received " + data.event + " event on " + new Date(data.timestamp * 1000) + " for " + data.type + " type");
    +}
    +
    +function errorCallback(error)
    +{
    +  console.log(error.name + ": " + error.message);
    +}
    +
    +try
    +{
    +  var listenerId = tizen.humanactivitymonitor.addGestureRecognitionListener("GESTURE_SHAKE", listener, errorCallback);
    +  tizen.humanactivitymonitor.removeGestureRecognitionListener(listenerId);
    +  console.log("Listener with id " + listenerId + " has been removed");
    +}
    +catch (error)
    +{
    +  console.log("Error " + error.name + ": " + error.message);
    +}
    +
    +
    +
    +

    Output example:

     Listener with id 1 has been removed
    + 
    +
    +
    @@ -1308,8 +1627,8 @@ catch (err)

    Code example:

     var option =
     {
    -   interval: 10,
    -   retentionPeriod: 1
    +  interval: 10,
    +  retentionPeriod: 1
     }
     
    @@ -1431,55 +1750,62 @@ For example, the anchorTime can be 1:00 am, January 1, 2000 or 1:00 am,

    Code example:

     function onerror(error)
     {
    -   console.log(error.name + ": " + error.message);
    +  console.log(error.name + ": " + error.message);
     }
     
     function onread(data)
     {
    -   for (var idx = 0; idx < data.length; ++idx)
    -   {
    -      console.log("*** " + idx);
    -      console.log('totalStepCount: ' + data[idx].totalStepCount);
    -   }
    +  for (var idx = 0; idx < data.length; ++idx)
    +  {
    +    console.log("*** " + idx);
    +    console.log("max pressure: " + data[idx].max);
    +    console.log("min pressure: " + data[idx].min);
    +    console.log("average: " + data[idx].average);
    +  }
     }
     
    -var type = 'PEDOMETER';
    +var type = "PRESSURE";
     var now = new Date();
    -var startTime = now.setDate(now.getDate() - 7);
    +var startTime = now.setDate(now.getDate() - 4);
     var anchorTime = (new Date(2000, 1, 2, 6)).getTime();
     var query =
     {
    -   startTime: startTime / 1000,
    -   anchorTime: anchorTime / 1000,
    -   interval: 1440 /* 1 day */
    +  startTime: startTime / 1000,
    +  anchorTime: anchorTime / 1000,
    +  interval: 1440 /* 1 day */
     };
    +
     try
     {
    -   tizen.humanactivitymonitor.readRecorderData(type, query, onread, onerror);
    +  tizen.humanactivitymonitor.readRecorderData(type, query, onread, onerror);
     }
     catch (err)
     {
    -   console.log(err.name + ': ' + err.message);
    +  console.log(err.name + ": " + err.message);
     }
     

    Output example:

     *** 0
    - totalStepCount: 3860
    + max pressure: 1013.00
    + min pressure: 930.00
    + average: 980.00
      *** 1
    - totalStepCount: 6705
    + max pressure: 1012.00
    + min pressure: 954.00
    + average: 986.00
      *** 2
    - totalStepCount: 4005
    + max pressure: 950.00
    + min pressure: 904.00
    + average: 932.00
      *** 3
    - totalStepCount: 2328
    + max pressure: 1012.00
    + min pressure: 920.00
    + average: 942.00
      *** 4
    - totalStepCount: 4705
    - *** 5
    - totalStepCount: 6446
    - *** 6
    - totalStepCount: 4103
    - *** 7
    - totalStepCount: 1456
    + max pressure: 1012.00
    + min pressure: 1005.00
    + average: 1008.00
      
    @@ -2309,8 +2635,80 @@ When a user takes off the watch device, the heartRate is set to -3. When a user +
    +

    2.20. GestureData

    +
    + The GestureData interface represents detected gesture information. +
    +
        [NoInterfaceObject] interface GestureData {
    +        readonly attribute GestureType type;
    +        readonly attribute GestureEvent event;
    +        readonly attribute long timestamp;
    +        readonly attribute double? x;
    +        readonly attribute double? y;
    +    };
    +

    + Since: + 4.0 +

    +
    +

    Attributes

    +
      +
    • + readonly +GestureType type
      + Identifier of gesture type. +
      +

      + Since: + 4.0 +

      +
    • +
    • + readonly +GestureEvent event
      + Event type related to the detected gesture. +
      +

      + Since: + 4.0 +

      +
    • +
    • + readonly +long timestamp
      + Time when gesture was detected. Epoch time in seconds. +
      +

      + Since: + 4.0 +

      +
    • +
    • + readonly +double x [nullable]
      + Tilt degree on X-axis. It is used only for GESTURE_TILT type. For other gesture types it is set to null. +
      +

      + Since: + 4.0 +

      +
    • +
    • + readonly +double y [nullable]
      + Tilt degree on Y-axis. It is used only for GESTURE_TILT type. For other gesture types it is set to null. +
      +

      + Since: + 4.0 +

      +
    • +
    +
    +
    -

    2.20. HumanActivityMonitorSuccessCallback

    +

    2.21. HumanActivityMonitorSuccessCallback

    The HumanActivityMonitorSuccessCallback interface is a callback interface that is invoked when new human activity data is available.
    @@ -2352,7 +2750,7 @@ When a user takes off the watch device, the heartRate is set to -3. When a user
    -

    2.21. HumanActivityReadRecorderSuccessCallback

    +

    2.22. HumanActivityReadRecorderSuccessCallback

    The HumanActivityReadRecorderSuccessCallback interface is a callback interface that is invoked when recorded human activity data is successfully read.
    @@ -2393,6 +2791,47 @@ When a user takes off the watch device, the heartRate is set to -3. When a user
    +
    +

    2.23. GestureRecognitionCallback

    +
    + The GestureRecognitionCallback describes a callback for the addGestureRecognitionListener() method. +
    +
        [Callback=FunctionOnly, NoInterfaceObject] interface GestureRecognitionCallback {
    +      void onsuccess(GestureData data);
    +    };
    +

    + Since: + 4.0 +

    +
    +

    Methods

    +
    +
    +onsuccess +
    +
    +
    + Called when a gesture is detected. +
    +
    void onsuccess(GestureData data);
    +             
    +

    + Since: + 4.0 +

    +
    +

    Parameters:

    +
      +
    • +data: + GestureData which contains information about detected gesture. +
    • +
    +
    +
    +
    +
    +

    3. Related Feature

    @@ -2424,6 +2863,14 @@ To guarantee that the wrist-up gesture recognition application runs on a device

    +To guarantee that the gesture recognition application runs on a device with gesture recognition feature, declare the following feature requirement in the config file: +

    +

    +
  • http://tizen.org/feature/sensor.gesture_recognition
  • +
    +
    +

    +

    To guarantee that the Heart Rate Monitor application runs on a device with heart rate monitor, declare the following feature requirements in the config file:

    @@ -2479,6 +2926,12 @@ To guarantee that the barometer(pressure) sensor application runs on a device wi enum SleepStatus { "ASLEEP", "AWAKE", "UNKNOWN" }; + enum GestureType { "GESTURE_DOUBLE_TAP", "GESTURE_MOVE_TO_EAR", "GESTURE_NO_MOVE", "GESTURE_PICK_UP", + "GESTURE_SHAKE", "GESTURE_SNAP", "GESTURE_TILT", "GESTURE_TURN_FACE_DOWN", "GESTURE_WRIST_UP" }; + enum GestureEvent { "GESTURE_EVENT_DETECTED", "GESTURE_SHAKE_DETECTED", "GESTURE_SHAKE_FINISHED", "GESTURE_SNAP_X_NEGATIVE", + "GESTURE_SNAP_X_POSITIVE", "GESTURE_SNAP_Y_NEGATIVE", "GESTURE_SNAP_Y_POSITIVE", "GESTURE_SNAP_Z_NEGATIVE", "GESTURE_SNAP_Z_POSITIVE" }; + + [NoInterfaceObject] interface HumanActivityMonitorManagerObject { readonly attribute HumanActivityMonitorManager humanactivitymonitor; }; @@ -2509,6 +2962,10 @@ To guarantee that the barometer(pressure) sensor application runs on a device wi HumanActivityRecorderQuery? query, HumanActivityReadRecorderSuccessCallback successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException); + + boolean isGestureSupported(GestureType type) raises(WebAPIException); + long addGestureRecognitionListener(GestureType type, GestureRecognitionCallback listener, optional ErrorCallback? errorCallback, optional boolean? alwaysOn) raises(WebAPIException); + void removeGestureRecognitionListener(long watchId) raises(WebAPIException); }; [NoInterfaceObject] interface StepDifference { @@ -2668,6 +3125,14 @@ To guarantee that the barometer(pressure) sensor application runs on a device wi readonly attribute double? average; }; + [NoInterfaceObject] interface GestureData { + readonly attribute GestureType type; + readonly attribute GestureEvent event; + readonly attribute long timestamp; + readonly attribute double? x; + readonly attribute double? y; + }; + [Callback=FunctionOnly, NoInterfaceObject] interface HumanActivityMonitorSuccessCallback { void onsuccess(optional HumanActivityData? humanactivitydata); @@ -2677,6 +3142,10 @@ To guarantee that the barometer(pressure) sensor application runs on a device wi void onsuccess(HumanActivityRecorderData[] humanactivitydata); }; + + [Callback=FunctionOnly, NoInterfaceObject] interface GestureRecognitionCallback { + void onsuccess(GestureData data); + }; };
    @@ -35,7 +43,7 @@ For more information about how to use Human Activity Monitor API, see
  • 1. Type Definitions
  • 2. Interfaces
  • @@ -130,6 +148,9 @@ For more information about how to use Human Activity Monitor API, see startRecorder (HumanActivityRecorderType type, optional HumanActivityRecorderOption option)
    void stopRecorder (HumanActivityRecorderType type)
    void readRecorderData (HumanActivityRecorderType type, HumanActivityRecorderQuery? query, HumanActivityReadRecorderSuccessCallback successCallback, optional ErrorCallback? errorCallback)
    +
    boolean isGestureSupported (GestureType type)
    +
    long addGestureRecognitionListener (GestureType type, GestureRecognitionCallback listener, optional ErrorCallback? errorCallback, optional boolean? alwaysOn)
    +
    void removeGestureRecognitionListener (long watchId)
    @@ -201,6 +222,10 @@ For more information about how to use Human Activity Monitor API, see GestureData + + + HumanActivityMonitorSuccessCallback
    void onsuccess (optional HumanActivityData? humanactivitydata)
    @@ -208,6 +233,10 @@ For more information about how to use Human Activity Monitor API, see HumanActivityReadRecorderSuccessCallback
    void onsuccess (HumanActivityRecorderData[] humanactivitydata)
    + +GestureRecognitionCallback +
    void onsuccess (GestureData data)
    +
    @@ -369,8 +398,8 @@ UNKNOWN - Sleep status could not be determined

    Code example:

     function onchangedCB(sleepInfo)
     {
    -   console.log("Sleep status: " + sleepInfo.status);
    -   console.log("Timestamp: " + sleepInfo.timestamp);
    +  console.log("Sleep status: " + sleepInfo.status);
    +  console.log("Timestamp: " + sleepInfo.timestamp);
     }
     
     tizen.humanactivitymonitor.start("SLEEP_MONITOR", onchangedCB);
    @@ -382,6 +411,74 @@ tizen.humanactivitymonitor.start("SLEEP_MONITOR", onchangedCB);
      
    +
    +

    1.7. GestureType

    +
    + Specifies the gesture types. +
    +
        enum GestureType { "GESTURE_DOUBLE_TAP", "GESTURE_MOVE_TO_EAR", "GESTURE_NO_MOVE", "GESTURE_PICK_UP",
    +                       "GESTURE_SHAKE", "GESTURE_SNAP", "GESTURE_TILT", "GESTURE_TURN_FACE_DOWN", "GESTURE_WRIST_UP" };
    +

    + Since: + 4.0 +

    +
    +
      +
    • +GESTURE_DOUBLE_TAP - The display of the mobile device is tapped twice
    • +
    • +GESTURE_MOVE_TO_EAR - The mobile device is moved near to an ear
    • +
    • +GESTURE_NO_MOVE - The mobile device is being stopped for a while
    • +
    • +GESTURE_PICK_UP - The mobile device is picked up
    • +
    • +GESTURE_SHAKE - The mobile device is quickly moved back and forth
    • +
    • +GESTURE_SNAP - The mobile device is moved along an axis and back
    • +
    • +GESTURE_TILT - The mobile device is tilted
    • +
    • +GESTURE_TURN_FACE_DOWN - The mobile device is flipped from face to back
    • +
    • +GESTURE_WRIST_UP - The wearable device is moved and faced up
    • +
    +
    +
    +
    +

    1.8. GestureEvent

    +
    + Specifies the gesture events. +
    +
        enum GestureEvent { "GESTURE_EVENT_DETECTED", "GESTURE_SHAKE_DETECTED", "GESTURE_SHAKE_FINISHED", "GESTURE_SNAP_X_NEGATIVE",
    +                        "GESTURE_SNAP_X_POSITIVE", "GESTURE_SNAP_Y_NEGATIVE", "GESTURE_SNAP_Y_POSITIVE", "GESTURE_SNAP_Z_NEGATIVE", "GESTURE_SNAP_Z_POSITIVE" };
    +

    + Since: + 4.0 +

    +
    +
      +
    • +GESTURE_EVENT_DETECTED - The gesture is detected
    • +
    • +GESTURE_SHAKE_DETECTED - Shake gesture is detected
    • +
    • +GESTURE_SHAKE_FINISHED - Shake gesture is finished
    • +
    • +GESTURE_SNAP_X_NEGATIVE - [-X] snap is detected
    • +
    • +GESTURE_SNAP_X_POSITIVE - [+X] snap is detected
    • +
    • +GESTURE_SNAP_Y_NEGATIVE - [-Y] snap is detected
    • +
    • +GESTURE_SNAP_Y_POSITIVE - [+Y] snap is detected
    • +
    • +GESTURE_SNAP_Z_NEGATIVE - [-Z] snap is detected
    • +
    • +GESTURE_SNAP_Z_POSITIVE - [+Z] snap is detected
    • +
    +
    +

    2. Interfaces

    @@ -430,6 +527,12 @@ The tizen.humanactivitymonitor object allows access to the human activi HumanActivityRecorderQuery? query, HumanActivityReadRecorderSuccessCallback successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException); + + boolean isGestureSupported(GestureType type) raises(WebAPIException); + + long addGestureRecognitionListener(GestureType type, GestureRecognitionCallback listener, optional ErrorCallback? errorCallback, optional boolean? alwaysOn) raises(WebAPIException); + + void removeGestureRecognitionListener(long watchId) raises(WebAPIException); };

    Since: @@ -516,20 +619,20 @@ The ErrorCallback method is launched with these error types:

    Code example:

     function onsuccessCB(pedometerInfo)
     {
    -   console.log("Step status: " + pedometerInfo.stepStatus);
    -   console.log("Cumulative total step count: " + pedometerInfo.cumulativeTotalStepCount);
    +  console.log("Step status: " + pedometerInfo.stepStatus);
    +  console.log("Cumulative total step count: " + pedometerInfo.cumulativeTotalStepCount);
     }
     
     function onerrorCB(error)
     {
    -   console.log("Error occurs. name:" + error.name + ", message: " + error.message);
    +  console.log("Error occurs. name:" + error.name + ", message: " + error.message);
     }
     
     function onchangedCB(pedometerdata)
     {
    -   console.log("From now on, you will be notified when the pedometer data changes.");
    -   /* To get the current data information */
    -   tizen.humanactivitymonitor.getHumanActivityData("PEDOMETER", onsuccessCB, onerrorCB);
    +  console.log("From now on, you will be notified when the pedometer data changes.");
    +  /* To get the current data information */
    +  tizen.humanactivitymonitor.getHumanActivityData("PEDOMETER", onsuccessCB, onerrorCB);
     }
     
     tizen.humanactivitymonitor.start("PEDOMETER", onchangedCB);
    @@ -635,8 +738,8 @@ For other types, only 'http://tizen.org/privilege/healthinfo' should be d
     

    Code example:

     function onchangedCB(pedometerInfo)
     {
    -   console.log("Step status: " + pedometerInfo.stepStatus);
    -   console.log("Cumulative total step count: " + pedometerInfo.cumulativeTotalStepCount);
    +  console.log("Step status: " + pedometerInfo.stepStatus);
    +  console.log("Cumulative total step count: " + pedometerInfo.cumulativeTotalStepCount);
     }
     
     tizen.humanactivitymonitor.start("PEDOMETER", onchangedCB);
    @@ -651,26 +754,27 @@ tizen.humanactivitymonitor.start("PEDOMETER", onchangedCB);
     

    Code example:

     function onchangedCB(info)
     {
    -   var gpsInfo = info.gpsInfo;
    -   for (var index = 0; index < gpsInfo.length; index++)
    -   {
    -      console.log("latitude: " + gpsInfo[index].latitude);
    -      console.log("longitude: " + gpsInfo[index].longitude);
    -   }
    +  var gpsInfo = info.gpsInfo;
    +  for (var index = 0; index < gpsInfo.length; index++)
    +  {
    +    console.log("latitude: " + gpsInfo[index].latitude);
    +    console.log("longitude: " + gpsInfo[index].longitude);
    +  }
     }
     
     function onerrorCB(error)
     {
    -   console.log("Error occurred. Name:" + error.name + ", message: " + error.message);
    +  console.log("Error occurred. Name:" + error.name + ", message: " + error.message);
     }
     
     try
     {
    -   tizen.humanactivitymonitor.start("GPS", onchangedCB, onerrorCB, {callbackInterval: 150000, sampleInterval: 1000});
    +  tizen.humanactivitymonitor.start("GPS", onchangedCB, onerrorCB,
    +                                   {callbackInterval: 150000, sampleInterval: 1000});
     }
     catch (err)
     {
    -   console.log(err.name + ": " + err.message);
    +  console.log(err.name + ": " + err.message);
     }
     
    @@ -797,8 +901,8 @@ Note that the setAccumulativePedometerListener() method does not need to call th

    Code example:

     function onchangedCB(pedometerInfo)
     {
    -   console.log("Step status: " + pedometerInfo.stepStatus);
    -   console.log("Accumulative total step count: " + pedometerInfo.accumulativeTotalStepCount);
    +  console.log("Step status: " + pedometerInfo.stepStatus);
    +  console.log("Accumulative total step count: " + pedometerInfo.accumulativeTotalStepCount);
     }
     
     tizen.humanactivitymonitor.setAccumulativePedometerListener(onchangedCB);
    @@ -907,23 +1011,23 @@ The ErrorCallback method is launched with this error type:
     

    Code example:

     function errorCallback(error)
     {
    -   console.log(error.name + ': ' + error.message);
    +  console.log(error.name + ": " + error.message);
     }
     
     function listener(info)
     {
    -   console.log('type: ' + info.type);
    -   console.log('timestamp: ' + info.timestamp);
    -   console.log('accuracy: ' + info.accuracy);
    +  console.log("type: "      + info.type);
    +  console.log("timestamp: " + info.timestamp);
    +  console.log("accuracy: "  + info.accuracy);
     }
     
     try
     {
    -   var listenerId = tizen.humanactivitymonitor.addActivityRecognitionListener("WALKING", listener, errorCallback);
    +  var listenerId = tizen.humanactivitymonitor.addActivityRecognitionListener("WALKING", listener, errorCallback);
     }
     catch (error)
     {
    -   console.log(error.name + ': ' + error.message);
    +  console.log(error.name + ": " + error.message);
     }
     
    @@ -975,25 +1079,25 @@ var listenerId; function errorCallback(error) { - console.log(error.name + ': ' + error.message); + console.log(error.name + ": " + error.message); } function listener(info) { - console.log('type: ' + info.type); - console.log('timestamp: ' + info.timestamp); - console.log('accuracy: ' + info.accuracy); + console.log("type: " + info.type); + console.log("timestamp: " + info.timestamp); + console.log("accuracy: " + info.accuracy); - tizen.humanactivitymonitor.removeActivityRecognitionListener(listenerId, errorCallback); + tizen.humanactivitymonitor.removeActivityRecognitionListener(listenerId, errorCallback); } try { - listenerId = tizen.humanactivitymonitor.addActivityRecognitionListener("WALKING", listener, errorCallback); + listenerId = tizen.humanactivitymonitor.addActivityRecognitionListener("WALKING", listener, errorCallback); } catch (error) { - console.log(error.name + ': ' + error.message); + console.log(error.name + ": " + error.message); }
    @@ -1064,18 +1168,19 @@ catch (error)

    Code example:

    -var type = 'PRESSURE';
    +var type = "PRESSURE";
     var options =
     {
    -   retentionPeriod: 1 /* 1 hour */
    +  retentionPeriod: 1 /* 1 hour */
     };
    +
     try
     {
    -   tizen.humanactivitymonitor.startRecorder(type, options);
    +  tizen.humanactivitymonitor.startRecorder(type, options);
     }
     catch (err)
     {
    -   console.log(err.name + ': ' + err.message);
    +  console.log(err.name + ": " + err.message);
     }
     
    @@ -1119,18 +1224,17 @@ catch (err)

    Code example:

    -var type = 'PRESSURE';
    +var type = "PRESSURE";
     try
     {
    -   tizen.humanactivitymonitor.startRecorder(type);
    +  tizen.humanactivitymonitor.startRecorder(type);
    +  /* Do something */
     
    -   /* Do something */
    -
    -   tizen.humanactivitymonitor.stopRecorder(type);
    +  tizen.humanactivitymonitor.stopRecorder(type);
     }
     catch (err)
     {
    -   console.log(err.name + ': ' + err.message);
    +  console.log(err.name + ": " + err.message);
     }
     
    @@ -1217,28 +1321,28 @@ NotFoundError: If no recorder data is available.

    Code example:

     function onerror(error)
     {
    -   console.log(error.name + ": " + error.message);
    +  console.log(error.name + ": " + error.message);
     }
     
     function onread(data)
     {
    -   for (var idx = 0; idx < data.length; ++idx)
    -   {
    -      console.log('startTime: ' + data[idx].startTime);
    -      console.log('endTime: ' + data[idx].endTime);
    -      console.log('calories: ' + data[idx].calorie);
    -   }
    +  for (var idx = 0; idx < data.length; ++idx)
    +  {
    +    console.log("startTime: " + data[idx].startTime);
    +    console.log("endTime: " + data[idx].endTime);
    +    console.log("calories: " + data[idx].calorie);
    +  }
     }
     
    -var type = 'PEDOMETER';
    +var type = "PEDOMETER";
     var query = {};
     try
     {
    -   tizen.humanactivitymonitor.readRecorderData(type, query, onread, onerror);
    +  tizen.humanactivitymonitor.readRecorderData(type, query, onread, onerror);
     }
     catch (err)
     {
    -   console.log(err.name + ': ' + err.message);
    +  console.log(err.name + ": " + err.message);
     }
     
    @@ -1249,6 +1353,216 @@ catch (err) +
    +isGestureSupported +
    +
    +
    + Checks if gesture type is supported on a device. +
    +
    boolean isGestureSupported(GestureType type);
    +             
    +

    + Since: + 4.0 +

    +
    +

    +This function allows to check whether a gesture type is supported on the current device. Some gestures may not be supported on some devices because of lack necessary sensors. +

    +
    +
    +

    Parameters:

    +
      +
    • +type: + Gesture type to check if it is supported on a device. +
    • +
    +
    +
    +

    Return value:

    + boolean true if the given gesture type is supported. +
    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + with error type TypeMismatchError, if input parameter is not compatible with the expected type. +

      • +
      • + with error type AbortError, if any error occurs. +

      • +
      +
    +
    +
    +

    Code example:

    +try
    +{
    +  var isSupported = tizen.humanactivitymonitor.isGestureSupported("GESTURE_PICK_UP");
    +  console.log("GESTURE_PICK_UP is " + (isSupported ? "supported" : "not supported"));
    +}
    +catch (error)
    +{
    +  console.log("Error " + error.name + ": " + error.message);
    +}
    +
    +
    +
    +

    Output example:

     GESTURE_PICK_UP is supported.
    + 
    +
    +
    +
    +addGestureRecognitionListener +
    +
    +
    + Adds a listener to be invoked when given gesture type is detected. +
    +
    long addGestureRecognitionListener(GestureType type, GestureRecognitionCallback listener, optional ErrorCallback? errorCallback, optional boolean? alwaysOn);
    +             
    +

    + Since: + 4.0 +

    +
    +

    +The ErrorCallback method is launched with this error type: +

    +
      +
    • + AbortError : If the system operation was aborted.
    • +
    +
    +
    +

    Parameters:

    +
      +
    • +type: + The gesture type to be monitored. +
    • +
    • +listener: + Listener to be called when gesture is detected or an error occurred. +
    • +
    • +errorCallback [optional] [nullable]: + Callback method to be invoked when an error occurs. +
    • +
    • +alwaysOn [optional] [nullable]: + The option of the monitored gesture mode. If it is set to false system may try to reduce power consumption, for example by stoping detecting gestures when display is turned off.
      If it is set to true power-saving functionality is off. Default value is false. +
    • +
    +
    +
    +

    Return value:

    + long The watch ID used to remove the listener. +
    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter. +

      • +
      • + with error type NotSupportedError, if the gesture recognition is not supported. +

      • +
      • + with error type IOError, if adding listener failed. +

      • +
      +
    +
    +
    +

    Code example:

    +function listener(data)
    +{
    +  console.log("Received " + data.event + " event on " + new Date(data.timestamp * 1000) + " for " + data.type + " type");
    +}
    +
    +function errorCallback(error)
    +{
    +  console.log(error.name + ": " + error.message);
    +}
    +
    +try
    +{
    +  var listenerId = tizen.humanactivitymonitor.addGestureRecognitionListener("GESTURE_SHAKE", listener, errorCallback, true);
    +  console.log("Listener with id " + listenerId + " has been added");
    +}
    +catch (error)
    +{
    +  console.log("Error " + error.name + ": " + error.message);
    +}
    +
    +
    +
    +

    Output example:

     Listener with id 1 has been added
    + Received GESTURE_SHAKE_DETECTED event on Thu Sep 01 2016 14:33:56 GMT+0200 (CEST) for GESTURE_SHAKE type
    + 
    +
    +
    +
    +removeGestureRecognitionListener +
    +
    +
    + Removes listener with the given id. +
    +
    void removeGestureRecognitionListener(long watchId);
    +             
    +

    + Since: + 4.0 +

    +
    +

    Parameters:

    +
      +
    • +watchId: + The ID of the registered listener. +
    • +
    +
    +
    +

    Exceptions:

    +
    • WebAPIException
      • + with error type AbortError, if system error occurs while removing listener. +

      +
    +
    +
    +

    Code example:

    +function listener(data)
    +{
    +  console.log("Received " + data.event + " event on " + new Date(data.timestamp * 1000) + " for " + data.type + " type");
    +}
    +
    +function errorCallback(error)
    +{
    +  console.log(error.name + ": " + error.message);
    +}
    +
    +try
    +{
    +  var listenerId = tizen.humanactivitymonitor.addGestureRecognitionListener("GESTURE_SHAKE", listener, errorCallback);
    +  tizen.humanactivitymonitor.removeGestureRecognitionListener(listenerId);
    +  console.log("Listener with id " + listenerId + " has been removed");
    +}
    +catch (error)
    +{
    +  console.log("Error " + error.name + ": " + error.message);
    +}
    +
    +
    +
    +

    Output example:

     Listener with id 1 has been removed
    + 
    +
    +
    @@ -1312,8 +1626,8 @@ catch (err)

    Code example:

     var option =
     {
    -   interval: 10,
    -   retentionPeriod: 1
    +  interval: 10,
    +  retentionPeriod: 1
     }
     
    @@ -1436,55 +1750,62 @@ For example, the anchorTime can be 1:00 am, January 1, 2000 or 1:00 am,

    Code example:

     function onerror(error)
     {
    -   console.log(error.name + ": " + error.message);
    +  console.log(error.name + ": " + error.message);
     }
     
     function onread(data)
     {
    -   for (var idx = 0; idx < data.length; ++idx)
    -   {
    -      console.log("*** " + idx);
    -      console.log('totalStepCount: ' + data[idx].totalStepCount);
    -   }
    +  for (var idx = 0; idx < data.length; ++idx)
    +  {
    +    console.log("*** " + idx);
    +    console.log("max pressure: " + data[idx].max);
    +    console.log("min pressure: " + data[idx].min);
    +    console.log("average: " + data[idx].average);
    +  }
     }
     
    -var type = 'PEDOMETER';
    +var type = "PRESSURE";
     var now = new Date();
    -var startTime = now.setDate(now.getDate() - 7);
    +var startTime = now.setDate(now.getDate() - 4);
     var anchorTime = (new Date(2000, 1, 2, 6)).getTime();
     var query =
     {
    -   startTime: startTime / 1000,
    -   anchorTime: anchorTime / 1000,
    -   interval: 1440 /* 1 day */
    +  startTime: startTime / 1000,
    +  anchorTime: anchorTime / 1000,
    +  interval: 1440 /* 1 day */
     };
    +
     try
     {
    -   tizen.humanactivitymonitor.readRecorderData(type, query, onread, onerror);
    +  tizen.humanactivitymonitor.readRecorderData(type, query, onread, onerror);
     }
     catch (err)
     {
    -   console.log(err.name + ': ' + err.message);
    +  console.log(err.name + ": " + err.message);
     }
     

    Output example:

     *** 0
    - totalStepCount: 3860
    + max pressure: 1013.00
    + min pressure: 930.00
    + average: 980.00
      *** 1
    - totalStepCount: 6705
    + max pressure: 1012.00
    + min pressure: 954.00
    + average: 986.00
      *** 2
    - totalStepCount: 4005
    + max pressure: 950.00
    + min pressure: 904.00
    + average: 932.00
      *** 3
    - totalStepCount: 2328
    + max pressure: 1012.00
    + min pressure: 920.00
    + average: 942.00
      *** 4
    - totalStepCount: 4705
    - *** 5
    - totalStepCount: 6446
    - *** 6
    - totalStepCount: 4103
    - *** 7
    - totalStepCount: 1456
    + max pressure: 1012.00
    + min pressure: 1005.00
    + average: 1008.00
      
    @@ -2314,8 +2635,80 @@ When a user takes off the watch device, the heartRate is set to -3. When a user +
    +

    2.20. GestureData

    +
    + The GestureData interface represents detected gesture information. +
    +
        [NoInterfaceObject] interface GestureData {
    +        readonly attribute GestureType type;
    +        readonly attribute GestureEvent event;
    +        readonly attribute long timestamp;
    +        readonly attribute double? x;
    +        readonly attribute double? y;
    +    };
    +

    + Since: + 4.0 +

    +
    +

    Attributes

    +
      +
    • + readonly +GestureType type
      + Identifier of gesture type. +
      +

      + Since: + 4.0 +

      +
    • +
    • + readonly +GestureEvent event
      + Event type related to the detected gesture. +
      +

      + Since: + 4.0 +

      +
    • +
    • + readonly +long timestamp
      + Time when gesture was detected. Epoch time in seconds. +
      +

      + Since: + 4.0 +

      +
    • +
    • + readonly +double x [nullable]
      + Tilt degree on X-axis. It is used only for GESTURE_TILT type. For other gesture types it is set to null. +
      +

      + Since: + 4.0 +

      +
    • +
    • + readonly +double y [nullable]
      + Tilt degree on Y-axis. It is used only for GESTURE_TILT type. For other gesture types it is set to null. +
      +

      + Since: + 4.0 +

      +
    • +
    +
    +
    -

    2.20. HumanActivityMonitorSuccessCallback

    +

    2.21. HumanActivityMonitorSuccessCallback

    The HumanActivityMonitorSuccessCallback interface is a callback interface that is invoked when new human activity data is available.
    @@ -2357,7 +2750,7 @@ When a user takes off the watch device, the heartRate is set to -3. When a user
    -

    2.21. HumanActivityReadRecorderSuccessCallback

    +

    2.22. HumanActivityReadRecorderSuccessCallback

    The HumanActivityReadRecorderSuccessCallback interface is a callback interface that is invoked when recorded human activity data is successfully read.
    @@ -2398,6 +2791,47 @@ When a user takes off the watch device, the heartRate is set to -3. When a user
    +
    +

    2.23. GestureRecognitionCallback

    +
    + The GestureRecognitionCallback describes a callback for the addGestureRecognitionListener() method. +
    +
        [Callback=FunctionOnly, NoInterfaceObject] interface GestureRecognitionCallback {
    +      void onsuccess(GestureData data);
    +    };
    +

    + Since: + 4.0 +

    +
    +

    Methods

    +
    +
    +onsuccess +
    +
    +
    + Called when a gesture is detected. +
    +
    void onsuccess(GestureData data);
    +             
    +

    + Since: + 4.0 +

    +
    +

    Parameters:

    +
      +
    • +data: + GestureData which contains information about detected gesture. +
    • +
    +
    +
    +
    +
    +

    3. Related Feature

    @@ -2429,6 +2863,14 @@ To guarantee that the wrist-up gesture recognition application runs on a device

    +To guarantee that the gesture recognition application runs on a device with gesture recognition feature, declare the following feature requirement in the config file: +

    +

    +
  • http://tizen.org/feature/sensor.gesture_recognition
  • +
    +
    +

    +

    To guarantee that the Heart Rate Monitor application runs on a device with heart rate monitor, declare the following feature requirements in the config file:

    @@ -2484,6 +2926,12 @@ To guarantee that the barometer(pressure) sensor application runs on a device wi enum SleepStatus { "ASLEEP", "AWAKE", "UNKNOWN" }; + enum GestureType { "GESTURE_DOUBLE_TAP", "GESTURE_MOVE_TO_EAR", "GESTURE_NO_MOVE", "GESTURE_PICK_UP", + "GESTURE_SHAKE", "GESTURE_SNAP", "GESTURE_TILT", "GESTURE_TURN_FACE_DOWN", "GESTURE_WRIST_UP" }; + enum GestureEvent { "GESTURE_EVENT_DETECTED", "GESTURE_SHAKE_DETECTED", "GESTURE_SHAKE_FINISHED", "GESTURE_SNAP_X_NEGATIVE", + "GESTURE_SNAP_X_POSITIVE", "GESTURE_SNAP_Y_NEGATIVE", "GESTURE_SNAP_Y_POSITIVE", "GESTURE_SNAP_Z_NEGATIVE", "GESTURE_SNAP_Z_POSITIVE" }; + + [NoInterfaceObject] interface HumanActivityMonitorManagerObject { readonly attribute HumanActivityMonitorManager humanactivitymonitor; }; @@ -2514,6 +2962,12 @@ To guarantee that the barometer(pressure) sensor application runs on a device wi HumanActivityRecorderQuery? query, HumanActivityReadRecorderSuccessCallback successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException); + + boolean isGestureSupported(GestureType type) raises(WebAPIException); + + long addGestureRecognitionListener(GestureType type, GestureRecognitionCallback listener, optional ErrorCallback? errorCallback, optional boolean? alwaysOn) raises(WebAPIException); + + void removeGestureRecognitionListener(long watchId) raises(WebAPIException); }; [NoInterfaceObject] interface StepDifference { @@ -2524,14 +2978,12 @@ To guarantee that the barometer(pressure) sensor application runs on a device wi }; dictionary HumanActivityRecorderOption { - long interval; long retentionPeriod; }; dictionary HumanActivityRecorderQuery { - long startTime; long endTime; @@ -2627,7 +3079,6 @@ To guarantee that the barometer(pressure) sensor application runs on a device wi long sampleInterval; }; - [NoInterfaceObject] interface HumanActivityRecognitionData : HumanActivityData { readonly attribute ActivityRecognitionType type; @@ -2676,6 +3127,14 @@ To guarantee that the barometer(pressure) sensor application runs on a device wi readonly attribute double? average; }; + [NoInterfaceObject] interface GestureData { + readonly attribute GestureType type; + readonly attribute GestureEvent event; + readonly attribute long timestamp; + readonly attribute double? x; + readonly attribute double? y; + }; + [Callback=FunctionOnly, NoInterfaceObject] interface HumanActivityMonitorSuccessCallback { void onsuccess(optional HumanActivityData? humanactivitydata); @@ -2685,6 +3144,10 @@ To guarantee that the barometer(pressure) sensor application runs on a device wi void onsuccess(HumanActivityRecorderData[] humanactivitydata); }; + + [Callback=FunctionOnly, NoInterfaceObject] interface GestureRecognitionCallback { + void onsuccess(GestureData data); + }; };