The following human activity monitor functionality is provided:
For more information about how to use Human Activity Monitor API, see Human Activity Monitor Guide.
Since: 2.3
Interface | Method |
---|---|
HumanActivityMonitorManagerObject | |
HumanActivityMonitorManager | void getHumanActivityData (HumanActivityType type, HumanActivityMonitorSuccessCallback successCallback, optional ErrorCallback? errorCallback) void start (HumanActivityType type, optional HumanActivityMonitorSuccessCallback? changedCallback) void stop (HumanActivityType type) void setAccumulativePedometerListener (HumanActivityMonitorSuccessCallback changeCallback) void unsetAccumulativePedometerListener () |
StepDifference | |
HumanActivityData | |
HumanActivityPedometerData | |
HumanActivityAccumulativePedometerData | |
HumanActivityHRMData | |
HumanActivityGPSInfo | |
HumanActivityGPSInfoArray | |
HumanActivityMonitorSuccessCallback | void onsuccess (optional HumanActivityData? humanactivitydata) |
enum HumanActivityType { "PEDOMETER", "WRIST_UP", "HRM", "GPS" };
Since: 2.3
The human activity monitor types defined by this enumerator are:
[NoInterfaceObject] interface HumanActivityMonitorManagerObject { readonly attribute HumanActivityMonitorManager humanactivitymonitor; };
Tizen implements HumanActivityMonitorManagerObject;
Since: 2.3
[NoInterfaceObject] interface HumanActivityMonitorManager { void getHumanActivityData(HumanActivityType type, HumanActivityMonitorSuccessCallback successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException); void start(HumanActivityType type, optional HumanActivityMonitorSuccessCallback? changedCallback) raises(WebAPIException); void stop(HumanActivityType type) raises(WebAPIException); void setAccumulativePedometerListener(HumanActivityMonitorSuccessCallback changeCallback) raises(WebAPIException); void unsetAccumulativePedometerListener() raises(WebAPIException); };
Since: 2.3
getHumanActivityData
void getHumanActivityData(HumanActivityType type, HumanActivityMonitorSuccessCallback successCallback, optional ErrorCallback? errorCallback);
Since: 2.3
If the given type is not supported on a device, NotSupportedError is thrown.
The start() method should be called to turn on the sensor before calling the getHumanActivityData() method. If not, ServiceNotAvailableError occurs.
The ErrorCallback method is launched with these error types:
Privilege level: public
Privilege: http://tizen.org/privilege/healthinfo
Privilege level: public
Privilege: http://tizen.org/privilege/location
Remark : The 'http://tizen.org/privilege/location' privilege is required for only GPS type. That means that both 'http://tizen.org/privilege/healthinfo' and 'http://tizen.org/privilege/location' should be declared in config.xml file for GPS type. In other types, only 'http://tizen.org/privilege/healthinfo' should be declared.
Parameters:
Exceptions:
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
with error type UnknownError, if registering the success callback fails because of an unknown error.
with error type NotSupportedError, if the given type is not supported on a device.
with error type SecurityError, if the application does not have the privilege to use this function.
Code example:
function onsuccessCB(pedometerInfo) { 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); } 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); } tizen.humanactivitymonitor.start("PEDOMETER", onchangedCB);
start
void start(HumanActivityType type, optional HumanActivityMonitorSuccessCallback? changedCallback);
Since: 2.3
Privilege level: public
Privilege: http://tizen.org/privilege/healthinfo
Privilege level: public
Privilege: http://tizen.org/privilege/location
Remark : When the CPU is in the power saving mode, WRIST_UP event might not occur even though <tizen:setting background-support="enable" /> is declared in config.xml file.
Remark : The 'http://tizen.org/privilege/location' privilege is required for only GPS type. That means that both 'http://tizen.org/privilege/healthinfo' and 'http://tizen.org/privilege/location' should be declared in config.xml file for GPS type. In other types, only 'http://tizen.org/privilege/healthinfo' should be declared.
Parameters:
Exceptions:
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
with error type UnknownError, if registering the listener fails because of an unknown error.
with error type NotSupportedError, if the given type is not supported on a device.
with error type SecurityError, if the application does not have the privilege to use this function.
Code example:
function onchangedCB(pedometerInfo) { console.log("Step status : " + pedometerInfo.stepStatus); console.log("Cumulative total step count : " + pedometerInfo.cumulativeTotalStepCount); } tizen.humanactivitymonitor.start("PEDOMETER", onchangedCB);
stop
void stop(HumanActivityType type);
Since: 2.3
Privilege level: public
Privilege: http://tizen.org/privilege/healthinfo
Privilege level: public
Privilege: http://tizen.org/privilege/location
Remark : The 'http://tizen.org/privilege/location' privilege is required for only GPS type. That means that both 'http://tizen.org/privilege/healthinfo' and 'http://tizen.org/privilege/location' should be declared in config.xml file for GPS type. In other types, only 'http://tizen.org/privilege/healthinfo' should be declared.
Parameters:
Exceptions:
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
with error type UnknownError, if unregistering the listener fails because of an unknown error.
with error type NotSupportedError, if the given type is not supported on a device.
with error type SecurityError, if the application does not have the privilege to use this function.
Code example:
tizen.humanactivitymonitor.stop("PEDOMETER");
setAccumulativePedometerListener
void setAccumulativePedometerListener(HumanActivityMonitorSuccessCallback changeCallback);
Since: 2.3
Note that the setAccumulativePedometerListener() method does not need to call the sensor's start() method.
Privilege level: public
Privilege: http://tizen.org/privilege/healthinfo
Parameters:
Exceptions:
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
with error type UnknownError, if registering the listener fails because of an unknown error.
with error type NotSupportedError, if the pedometer sensor is not supported on a device.
with error type SecurityError, if the application does not have the privilege to call this method.
Code example:
function onchangedCB(pedometerInfo) { console.log("Step status : " + pedometerInfo.stepStatus); console.log("Accumulative total step count : " + pedometerInfo.accumulativeTotalStepCount); } tizen.humanactivitymonitor.setAccumulativePedometerListener(onchangedCB);
unsetAccumulativePedometerListener
void unsetAccumulativePedometerListener();
Since: 2.3
Privilege level: public
Privilege: http://tizen.org/privilege/healthinfo
Exceptions:
with error type UnknownError, if unregistering the listener fails because of an unknown error.
with error type SecurityError, if the application does not have the privilege to call this method.
Code example:
tizen.humanactivitymonitor.unsetAccumulativePedometerListener();
[NoInterfaceObject] interface StepDifference { readonly attribute long stepCountDifference; readonly attribute long timestamp; };
Since: 2.3
Since: 2.3
Since: 2.3
[NoInterfaceObject] interface HumanActivityData { };
Since: 2.3
[NoInterfaceObject] interface HumanActivityPedometerData : HumanActivityData { readonly attribute PedometerStepStatus stepStatus; readonly attribute double speed; readonly attribute double walkingFrequency; readonly attribute double cumulativeDistance; readonly attribute double cumulativeCalorie; readonly attribute double cumulativeTotalStepCount; readonly attribute double cumulativeWalkStepCount; readonly attribute double cumulativeRunStepCount; readonly attribute StepDifference[] stepCountDifferences; };
Since: 2.3
Since: 2.3
Since: 2.3
Since: 2.3
Since: 2.3
Since: 2.3
The value is the sum of cumulativeWalkStepCount and cumulativeRunStepCount.
Since: 2.3
Since: 2.3
Since: 2.3
Since: 2.3
[NoInterfaceObject] interface HumanActivityAccumulativePedometerData : HumanActivityData { readonly attribute PedometerStepStatus stepStatus; readonly attribute double speed; readonly attribute double walkingFrequency; readonly attribute double accumulativeDistance; readonly attribute double accumulativeCalorie; readonly attribute double accumulativeTotalStepCount; readonly attribute double accumulativeWalkStepCount; readonly attribute double accumulativeRunStepCount; readonly attribute StepDifference[] stepCountDifferences; };
Since: 2.3
Since: 2.3
Since: 2.3
Since: 2.3
Since: 2.3
Since: 2.3
The value is the sum of accumulativeWalkStepCount and accumulativeRunStepCount.
Since: 2.3
Since: 2.3
Since: 2.3
Since: 2.3
[NoInterfaceObject] interface HumanActivityHRMData : HumanActivityData { readonly attribute long heartRate; readonly attribute long rRInterval; };
Since: 2.3
Since: 2.3
Since: 2.3
[NoInterfaceObject] interface HumanActivityGPSInfo { readonly attribute double latitude; readonly attribute double longitude; readonly attribute double altitude; readonly attribute double speed; readonly attribute long errorRange; readonly attribute long timestamp; };
Since: 2.3
Since: 2.3
Since: 2.3
Since: 2.3
Since: 2.3
Since: 2.3
Since: 2.3
[NoInterfaceObject] interface HumanActivityGPSInfoArray : HumanActivityData { readonly attribute HumanActivityGPSInfo[] gpsInfo; };
Since: 2.3
Since: 2.3
[Callback=FunctionOnly, NoInterfaceObject] interface HumanActivityMonitorSuccessCallback { void onsuccess(optional HumanActivityData? humanactivitydata); };
Since: 2.3
onsuccess
void onsuccess(optional HumanActivityData? humanactivitydata);
Since: 2.3
Parameters:
To guarantee that the Human Activity Monitor application runs on a device which supports this API, declare the following feature requirements in the config file:
To guarantee that the pedometer application runs on a device with pedometer, declare the following feature requirements in the config file:
To guarantee that the wrist-up gesture recognition application runs on a device with wrist up, declare the following feature requirements in the config file:
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:
To guarantee that the GPS batch information tracking application runs on a device with GPS batch feature, declare the following feature requirements in the config file:
module HumanActivityMonitor { enum HumanActivityType { "PEDOMETER", "WRIST_UP", "HRM", "GPS" }; enum PedometerStepStatus { "NOT_MOVING", "WALKING", "RUNNING" }; [NoInterfaceObject] interface HumanActivityMonitorManagerObject { readonly attribute HumanActivityMonitorManager humanactivitymonitor; }; Tizen implements HumanActivityMonitorManagerObject; [NoInterfaceObject] interface HumanActivityMonitorManager { void getHumanActivityData(HumanActivityType type, HumanActivityMonitorSuccessCallback successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException); void start(HumanActivityType type, optional HumanActivityMonitorSuccessCallback? changedCallback) raises(WebAPIException); void stop(HumanActivityType type) raises(WebAPIException); void setAccumulativePedometerListener(HumanActivityMonitorSuccessCallback changeCallback) raises(WebAPIException); void unsetAccumulativePedometerListener() raises(WebAPIException); }; [NoInterfaceObject] interface StepDifference { readonly attribute long stepCountDifference; readonly attribute long timestamp; }; [NoInterfaceObject] interface HumanActivityData { }; [NoInterfaceObject] interface HumanActivityPedometerData : HumanActivityData { readonly attribute PedometerStepStatus stepStatus; readonly attribute double speed; readonly attribute double walkingFrequency; readonly attribute double cumulativeDistance; readonly attribute double cumulativeCalorie; readonly attribute double cumulativeTotalStepCount; readonly attribute double cumulativeWalkStepCount; readonly attribute double cumulativeRunStepCount; readonly attribute StepDifference[] stepCountDifferences; }; [NoInterfaceObject] interface HumanActivityAccumulativePedometerData : HumanActivityData { readonly attribute PedometerStepStatus stepStatus; readonly attribute double speed; readonly attribute double walkingFrequency; readonly attribute double accumulativeDistance; readonly attribute double accumulativeCalorie; readonly attribute double accumulativeTotalStepCount; readonly attribute double accumulativeWalkStepCount; readonly attribute double accumulativeRunStepCount; readonly attribute StepDifference[] stepCountDifferences; }; [NoInterfaceObject] interface HumanActivityHRMData : HumanActivityData { readonly attribute long heartRate; readonly attribute long rRInterval; }; [NoInterfaceObject] interface HumanActivityGPSInfo { readonly attribute double latitude; readonly attribute double longitude; readonly attribute double altitude; readonly attribute double speed; readonly attribute long errorRange; readonly attribute long timestamp; }; [NoInterfaceObject] interface HumanActivityGPSInfoArray : HumanActivityData { readonly attribute HumanActivityGPSInfo[] gpsInfo; }; [Callback=FunctionOnly, NoInterfaceObject] interface HumanActivityMonitorSuccessCallback { void onsuccess(optional HumanActivityData? humanactivitydata); }; };