Motion API (Samsung Extension)

This API defines interfaces and methods to manage motion data from various sensors on the device.

The following motion functionalities are provided:

Since: 2.2

Table of Contents


Summary of Interfaces and Methods

Interface Method
MotionManagerObject
MotionManager void getMotionInfo (MotionType type, MotionInfoSuccessCallback successCallback, optional ErrorCallback? errorCallback)
void start (MotionType type, optional MotionInfoSuccessCallback? changeCallback)
void stop (MotionType type)
void setAccumulativePedometerListener (MotionInfoSuccessCallback changeCallback)
void unsetAccumulativePedometerListener ()
void startHandGestureRecognition (HandGestureInfoChangeCallback changeCallback, BodySide bodySide, RecognitionMode recognitionMode)
void stopHandGestureRecognition ()
MotionInfo
MotionPedometerInfo
MotionAccumulativePedometerInfo
MotionHRMInfo
MotionGPSInfo
MotionGPSInfoArray
MotionHandGestureInfo
MotionStepDifference
MotionActivityRecognitionInfo
MotionInfoSuccessCallback void onsuccess (optional MotionInfo? motionInfo)
HandGestureInfoChangeCallback void onsuccess (optional MotionHandGestureInfo? gestureInfo)

1. Type Definitions

1.1. MotionType

Supported motion types.

Deprecated. PEDOMETER, WRIST_UP, HRM, GPS is deprecated since Tizen 2.3. It is recommended to use the Tizen Public Human Activity Monitor API(tizen.humanactivitymonitor since Tizen 2.3) instead.

    enum MotionType { "PEDOMETER", "WRIST_UP", "HRM", "GPS", "PALM_TOUCH", "ACTIVITY_RECOGNITION" };

Since: 2.2

The motion types defined by this enumerator are:

  • PEDOMETER - Pedometer data
  • WRIST_UP - Wrist up gesture
  • HRM - Heart rate monitor(Heart rate and RR interval) Since: 2.2.1.3
  • GPS - GPS information(latitude, longitude and speed) Since: 2.2.1.3
  • PALM_TOUCH - Palm touch event Since: 2.2.1.4
  • ACTIVITY_RECOGNITION - User activity recognition Since: 2.2.1.4

1.2. PedometerStepStatus

Step status of the pedometer user.

Deprecated. PedometerStepStatus is deprecated since Tizen 2.3. It is recommended to use the Tizen Public Human Activity Monitor API(tizen.humanactivitymonitor since Tizen 2.3) instead.

    enum PedometerStepStatus { "NOT_MOVING", "WALKING", "RUNNING" };

Since: 2.2

  • NOT_MOVING -The user remains stationary
  • WALKING - The user is walking
  • RUNNING - The user is running

1.3. BodySide

Indicates which side of the body to wear a device on
    enum BodySide { "LEFT_BODY_SIDE", "RIGHT_BODY_SIDE" };

Since: 2.2.1.3

  • LEFT_BODY_SIDE - a device worn on the left side of the body
  • RIGHT_BODY_SIDE - a device worn on the right side of the body

1.4. RecognitionMode

Recognition unit of gesture.
    enum RecognitionMode { "ONE_WAY_MODE", "ROUND_TRIP_MODE", "MIXED_MODE" };

Since: 2.2.1.3

  • ONE_WAY_MODE -The recognition unit of gesture is one way
  • ROUND_TRIP_MODE - The recognition unit of gesture is round trip
  • MIXED_MODE - The recognition unit of gesture is one way and round trip

1.5. HandGestureEvent

Gesture event.
    enum HandGestureEvent { "MOVE_LEFT", "MOVE_RIGHT",  "MOVE_UP", "MOVE_DOWN", "MOVE_FORWARD" };

Since: 2.2.1.3

  • MOVE_LEFT - A device is moved to left
  • MOVE_RIGHT - A device is moved to right
  • MOVE_UP - A device is moved upward
  • MOVE_DOWN - A device is moved downward
  • MOVE_FORWARD - A device is moved forward

1.6. ActivityRecognitionEvent

Activity event.
    enum ActivityRecognitionEvent { "ACTIVITY_STATIONARY", "ACTIVITY_WALK",  "ACTIVITY_RUN", "ACTIVITY_VEHICLE" };

Since: 2.2.1.4

  • ACTIVITY_STATIONARY - User is nearly stationary
  • ACTIVITY_WALK - User is walking
  • ACTIVITY_RUN - User is running
  • ACTIVITY_VEHICLE - User is in a moving vehicle

2. Interfaces

2.1. MotionManagerObject

The MotionManagerObject interface defines what is instantiated by the WebAPIs object. The webapis.motion object allows access to the motion data.
    [NoInterfaceObject] interface MotionManagerObject {
        readonly attribute MotionManager motion;
    };
    WebAPIs  implements MotionManagerObject;

Since: 2.2

2.2. MotionManager

The MotionManagerObject interface provides methods to access motion data.
    [NoInterfaceObject] interface MotionManager {

        void getMotionInfo(MotionType type, MotionInfoSuccessCallback successCallback,
                                optional ErrorCallback? errorCallback );

        void start(MotionType type, optional MotionInfoSuccessCallback? changeCallback);

        void stop(MotionType type);

        void setAccumulativePedometerListener(MotionInfoSuccessCallback changeCallback);

        void unsetAccumulativePedometerListener(); 

        void startHandGestureRecognition (HandGestureInfoChangeCallback changeCallback, BodySide bodySide, RecognitionMode recognitionMode);

        void stopHandGestureRecognition(); 
    };

Since: 2.2

Methods

getMotionInfo
Gets the current motion data for the requested type.

Deprecated. getMotionInfo() is deprecated since Tizen 2.3. It is recommended to use the Tizen Public Human Activity Monitor API(tizen.humanactivitymonitor since Tizen 2.3) instead.

void getMotionInfo(MotionType type, MotionInfoSuccessCallback successCallback, optional ErrorCallback? errorCallback);
             

Since: 2.2

Note that the getMotionInfo method only supports the PEDOMETER type. If MotionType is not equal to PEDOMETER, TypeMismtatchError is thrown.

The start method should be called to turn on the pedometer sensor before calling the getMotionInfo method.

The ErrorCallback is launched with these error types:

  • ServiceNotAvailableError : If the getMotionInfo method is called without previously calling the start method with PEDOMETER type.

Privilege level: public

Privilege: http://developer.samsung.com/privilege/healthinfo

Parameters:

  • type: Motion type to read
  • successCallback: Callback method to be invoked when the motion data has been read
  • errorCallback [optional] [nullable]: Callback method to be invoked when an error occurs

Exceptions:

  • WebAPIException
    • 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 this feature is not supported.

    • with error type SecurityError, if the application does not have the privilege to use this method.

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");
 } 

 webapis.motion.getMotionInfo("PEDOMETER", onsuccessCB, onerrorCB);
 
start
Starts the sensor and registers a change listener to be called when new motion data for a given motion type is available.

Deprecated. http://developer.samsung.com/privilege/healthinfo privilege is deprecated since Tizen 2.3. It is recommended to use the http://tizen.org/privilege/healthinfo privilege (since Tizen 2.3) instead.

void start(MotionType type, optional MotionInfoSuccessCallback? changeCallback);
             

Since: 2.2

Privilege level: public

Privilege: http://tizen.org/privilege/healthinfo

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.

Parameters:

  • type: The motion type to register a listener for
  • changeCallback [optional] [nullable]: Callback method to be invoked when new motion data is available
    Note that the listener is not called for the successful start of a motion sensor

Exceptions:

  • WebAPIException
    • 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 feature is not supported.

    • 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("Cumulative total step count : " + pedometerInfo.cumulativeTotalStepCount);
 } 

 webapis.motion.start("PEDOMETER", onchangedCB);
 
stop
Stops the sensor and unregisters a previously registered listener for available motion data.

Deprecated. http://developer.samsung.com/privilege/healthinfo privilege is deprecated since Tizen 2.3. It is recommended to use the http://tizen.org/privilege/healthinfo privilege (since Tizen 2.3) instead.

void stop(MotionType type);
             

Since: 2.2

Privilege level: public

Privilege: http://tizen.org/privilege/healthinfo

Parameters:

  • type: Motion type to unregister the listener for

Exceptions:

  • WebAPIException
    • 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 this feature is not supported.

    • with error type SecurityError, if the application does not have the privilege to call this method.

Code example:

 webapis.motion.stop("PEDOMETER");
 
setAccumulativePedometerListener
Starts the sensor and registers a listener to be called when a new accumulative pedometer data is available.

Deprecated. setAccumulativePedometerListener() is deprecated since Tizen 2.3. It is recommended to use the Tizen Public Human Activity Monitor API(tizen.humanactivitymonitor since Tizen 2.3) instead.

void setAccumulativePedometerListener(MotionInfoSuccessCallback changeCallback);
             

Since: 2.2.1.2

Note that setAccumulativePedometerListener method don't need to call the start method of a motion sensor

Privilege level: public

Privilege: http://developer.samsung.com/privilege/healthinfo

Parameters:

  • changeCallback: Callback method to be invoked when the accumulative pedometer data changes. Callback will be invoked with MotionAccumulativePedometerInfo as argument.

Exceptions:

  • WebAPIException
    • 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 feature is not supported.

    • 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);
 } 

 webapis.motion.setAccumulativePedometerListener(onchangedCB);
 
unsetAccumulativePedometerListener
Stops the sensor and unregisters a previously registered listener for the accumulative pedometer data.

Deprecated. unsetAccumulativePedometerListener() is deprecated since Tizen 2.3. It is recommended to use the Tizen Public Human Activity Monitor API(tizen.humanactivitymonitor since Tizen 2.3) instead.

void unsetAccumulativePedometerListener();
             

Since: 2.2.1.2

Privilege level: public

Privilege: http://developer.samsung.com/privilege/healthinfo

Exceptions:

  • WebAPIException
    • 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 this feature is not supported.

    • with error type SecurityError, if the application does not have the privilege to call this method.

Code example:

 webapis.motion.unsetAccumulativePedometerListener();
 
startHandGestureRecognition
Registers a listener to be called when a new gesture event is available.
void startHandGestureRecognition(HandGestureInfoChangeCallback changeCallback, BodySide bodySide, RecognitionMode recognitionMode);
             

Since: 2.2.1.3

Parameters:

  • changeCallback: Callback method to be invoked for gesture events. Callback will be invoked with MotionGestureInfo as the argument.
  • bodySide: Side of the body (e.g. which hand) to wear the device
  • recognitionMode: Recognition unit of gesture event.

Exceptions:

  • WebAPIException
    • 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 feature is not supported.

Code example:

 function onchangedCB(resultInfo) {
        console.log("Event : "+ resultInfo.gestureEvent);
 } 

 webapis.motion.startHandGestureRecognition(onchangedCB, "RIGHT_BODY_SIDE", "ROUND_TRIP_MODE");
 
stopHandGestureRecognition
Stops the sensor and unregisters a previously registered listener for the hand gesture events.
void stopHandGestureRecognition();
             

Since: 2.2.1.3

Exceptions:

  • WebAPIException
    • with error type UnknownError, if unregistering the listener fails because of an unknown error.

Code example:

 webapis.motion.stopHandGestureRecognition();
 

2.3. MotionInfo

The MotionInfo interface is a common abstract interface used by various motion information objects.
    [NoInterfaceObject] interface MotionInfo {
     };

Since: 2.2

2.4. MotionPedometerInfo

The MotionPedometerInfo interface represents pedometer motion data.

Deprecated. MotionPedometerInfo interface is deprecated since Tizen 2.3. It is recommended to use the Tizen Public Human Activity Monitor API(tizen.humanactivitymonitor since Tizen 2.3) instead.

    [NoInterfaceObject] interface MotionPedometerInfo : MotionInfo {

        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 MotionStepDifference[] stepCountDifferences;
    };

Since: 2.2

Attributes

  • readonly PedometerStepStatus stepStatus
    The current movement type.

    Since: 2.2

  • readonly double speed
    Current speed in km/h.

    Since: 2.2

  • readonly double walkingFrequency
    Step count per second.

    Since: 2.2

  • readonly double cumulativeDistance
    Cumulative distance traveled since the last start() method call in meters.

    Since: 2.2

  • readonly double cumulativeCalorie
    Cumulative calories burned since the last start() method call in kcal.

    Since: 2.2

  • readonly double cumulativeTotalStepCount
    Cumulative walking and running step count since the last start() method call.

    Since: 2.2

  • readonly double cumulativeWalkStepCount
    Cumulative walking step count since the last start() method call.

    Since: 2.2

  • readonly double cumulativeRunStepCount
    Cumulative running step count since the last start() method call.

    Since: 2.2

  • readonly MotionStepDifference[] stepCountDifferences
    Array of the StepDifference.

    Since: 2.2.1.3

2.5. MotionAccumulativePedometerInfo

The MotionAccumulativePedometerInfo interface represents pedometer motion data when the device is booted.

Deprecated. MotionAccumulativePedometerInfo interface is deprecated since Tizen 2.3. It is recommended to use the Tizen Public Human Activity Monitor API(tizen.humanactivitymonitor since Tizen 2.3) instead.

    [NoInterfaceObject] interface MotionAccumulativePedometerInfo : MotionInfo {

        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 MotionStepDifference[] stepCountDifferences;
    };

Since: 2.2.1.2

Attributes

  • readonly PedometerStepStatus stepStatus
    Current movement type.

    Since: 2.2.1.2

  • readonly double speed
    Current speed in km/h.

    Since: 2.2.1.2

  • readonly double walkingFrequency
    Step count per second.

    Since: 2.2.1.2

  • readonly double accumulativeDistance
    Accumulative distance traveled since the device is booted in meters.

    Since: 2.2.1.2

  • readonly double accumulativeCalorie
    Accumulative calories burnt since the device is booted in kcal.

    Since: 2.2.1.2

  • readonly double accumulativeTotalStepCount
    An attribute to indicate the accumulative walking and running step count since the device was booted. The value is the sum of accumulativeWalkStepCount and accumulativeRunStepCount.
    Accumulative walking and running step count since the device is booted.

    The value is the sum of accumulativeWalkStepCount and accumulativeRunStepCount.

    Since: 2.2.1.2

  • readonly double accumulativeWalkStepCount
    Accumulative walking step count since the device is booted.

    Since: 2.2.1.2

  • readonly double accumulativeRunStepCount
    Accumulative running step count since the device is booted.

    Since: 2.2.1.2

  • readonly MotionStepDifference[] stepCountDifferences
    Array of the StepDifference.

    Since: 2.2.1.3

2.6. MotionHRMInfo

The MotionHRMInfo interface represents Heart Rate Monitor(HRM) data.

Deprecated. MotionHRMInfo interface is deprecated since Tizen 2.3. It is recommended to use the Tizen Public Human Activity Monitor API(tizen.humanactivitymonitor since Tizen 2.3) instead.

    [NoInterfaceObject] interface MotionHRMInfo : MotionInfo {

        readonly attribute long heartRate;

        readonly attribute long rRInterval;
    };

Since: 2.2

Attributes

  • readonly long heartRate
    An attribute to indicate the heart rate in beats per minute. When a user takes off the watch device, the heartRate is set to -3. When a user shakes the watch, the heartRate is set to -2.

    Since: 2.2

  • readonly long rRInterval
    Peak-to-peak interval in millisecond(s).

    Since: 2.2

2.7. MotionGPSInfo

The MotionGPSInfo interface represents GPS information.

Deprecated. MotionGPSInfo interface is deprecated since Tizen 2.3. It is recommended to use the Tizen Public Human Activity Monitor API(tizen.humanactivitymonitor since Tizen 2.3) instead.

    [NoInterfaceObject] interface MotionGPSInfo {

        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.2.1.3

Attributes

  • readonly double latitude
    An attribute to indicate the user's latitude in degrees.

    Since: 2.2.1.3

  • readonly double longitude
    An attribute to indicate the user's longitude in degrees.

    Since: 2.2.1.3

  • readonly double altitude
    An attribute to indicate the user's altitude in meters.

    Since: 2.2.1.3

  • readonly double speed
    An attribute to indicate the speed in km/h.

    Since: 2.2.1.3

  • readonly long errorRange
    An attribute to indicate the error range of the user's position in meters.

    Since: 2.2.1.3

  • readonly long timestamp
    An attribute to indicate time stamp in seconds.

    Since: 2.2.1.3

2.8. MotionGPSInfoArray

The MotionGPSInfoArray interface represents GPS information array.

Deprecated. MotionGPSInfoArray interface is deprecated since Tizen 2.3. It is recommended to use the Tizen Public Human Activity Monitor API(tizen.humanactivitymonitor since Tizen 2.3) instead.

    [NoInterfaceObject] interface MotionGPSInfoArray  : MotionInfo {

        readonly attribute MotionGPSInfo[] gpsInfo;
    };

Since: 2.2.1.3

Attributes

  • readonly MotionGPSInfo[] gpsInfo
    An attribute to indicate the array of GPS information.

    Since: 2.2.1.3

2.9. MotionHandGestureInfo

The MotionHandGestureInfo interface represents the information of gesture event.
    [NoInterfaceObject] interface MotionHandGestureInfo : MotionInfo {

        readonly attribute HandGestureEvent gestureEvent;

        readonly attribute double acceleration;

        readonly attribute long durationTime;
    };

Since: 2.2.1.3

Attributes

  • readonly HandGestureEvent gestureEvent
    Gesture event.

    Since: 2.2.1.3

  • readonly double acceleration
    Gesture acceleration rate in m/s².

    Since: 2.2.1.3

  • readonly long durationTime
    Gesture duration in milliseconds.

    Since: 2.2.1.3

2.10. MotionStepDifference

The MotionStepDifference interface represents the count difference between steps and time stamp.

Deprecated. MotionStepDifference interface is deprecated since Tizen 2.3. It is recommended to use the Tizen Public Human Activity Monitor API(tizen.humanactivitymonitor since Tizen 2.3) instead.

    [NoInterfaceObject] interface MotionStepDifference {

        readonly attribute long stepCountDifference;

        readonly attribute long timestamp;
    };

Since: 2.2.1.3

Attributes

  • readonly long stepCountDifference
    An attribute to indicate the count difference between steps.

    Since: 2.2.1.3

  • readonly long timestamp
    An attribute to indicate time stamp in seconds.

    Since: 2.2.1.3

2.11. MotionActivityRecognitionInfo

The MotionActivityRecognitionInfo interface represents the information of activity event.
    [NoInterfaceObject] interface MotionActivityRecognitionInfo  : MotionInfo {

        readonly attribute ActivityRecognitionEvent activityEvent;
    };

Since: 2.2.1.4

Attributes

  • readonly ActivityRecognitionEvent activityEvent
    Activity event.

    Since: 2.2.1.4

2.12. MotionInfoSuccessCallback

The MotionInfoSuccessCallback interface is a callback interface that is invoked when the motion data has changed. For example, see MotionManager interface
    [Callback=FunctionOnly, NoInterfaceObject] interface MotionInfoSuccessCallback {
        void onsuccess(optional MotionInfo? motionInfo);
    };

Since: 2.2

Methods

onsuccess
Called when there is new motion data available.
void onsuccess(optional MotionInfo? motionInfo);
             

Since: 2.2

Parameters:

  • motionInfo [optional] [nullable]: The current motion data. Note that null is passed for the WRIST_UP type.

2.13. HandGestureInfoChangeCallback

The HandGestureInfoChangeCallback interface is a callback interface that is invoked when the new gesture event is available.
    [Callback=FunctionOnly, NoInterfaceObject] interface HandGestureInfoChangeCallback {
        void onsuccess(optional MotionHandGestureInfo? gestureInfo);
    };

Since: 2.2.1.3

Methods

onsuccess
Called when there is new motion data available.
void onsuccess(optional MotionHandGestureInfo? gestureInfo);
             

Since: 2.2.1.3

Parameters:

  • gestureInfo [optional] [nullable]: The new gesture event.

3. Related Feature

It is recommended to design feature related code in a modular way.

To guarantee that the pedometer application runs on a device with pedometer, declare the following feature requirements in the config file:

  • http://developer.samsung.com/tizen/feature/pedometer
  • 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:

  • http://developer.samsung.com/tizen/feature/wrist_up
  • 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:

  • http://developer.samsung.com/tizen/feature/heart_rate_monitor
  • To guarantee that the GPS information tracking application runs on a device with GPS sensor, declare the following feature requirements in the config file:

  • http://tizen.org/feature/location.gps
  • http://developer.samsung.com/tizen/feature/samsung_extension
  • To guarantee that the hand gesture recognition application runs on a device with gesture recognition, declare the following feature requirements in the config file:

  • http://tizen.org/feature/sensor.gyroscope
  • http://tizen.org/feature/sensor.accelerometer
  • http://developer.samsung.com/tizen/feature/samsung_extension
  • To guarantee that the palm touch event application runs on a device, declare the following feature requirements in the config file:

  • http://developer.samsung.com/tizen/feature/multi_point_touch.palm_touch
  • To guarantee that the Activity recognition information tracking application runs on a device, declare the following feature requirements in the config file:

  • http://tizen.org/feature/sensor.activity_recognition
  • http://developer.samsung.com/tizen/feature/samsung_extension
  • 4. Full WebIDL

    module Motion {
    
        enum MotionType { "PEDOMETER", "WRIST_UP", "HRM", "GPS", "PALM_TOUCH", "ACTIVITY_RECOGNITION" };
    
        enum PedometerStepStatus { "NOT_MOVING", "WALKING", "RUNNING" };
    
        enum BodySide { "LEFT_BODY_SIDE", "RIGHT_BODY_SIDE" };
    
        enum RecognitionMode { "ONE_WAY_MODE", "ROUND_TRIP_MODE", "MIXED_MODE" };
    
        enum HandGestureEvent { "MOVE_LEFT", "MOVE_RIGHT",  "MOVE_UP", "MOVE_DOWN", "MOVE_FORWARD" };
    
        enum ActivityRecognitionEvent { "ACTIVITY_STATIONARY", "ACTIVITY_WALK",  "ACTIVITY_RUN", "ACTIVITY_VEHICLE" };
    
        [NoInterfaceObject] interface MotionManagerObject {
            readonly attribute MotionManager motion;
        };
        WebAPIs  implements MotionManagerObject;
    
        [NoInterfaceObject] interface MotionManager {
    
            void getMotionInfo(MotionType type, MotionInfoSuccessCallback successCallback,
                                    optional ErrorCallback? errorCallback );
    
            void start(MotionType type, optional MotionInfoSuccessCallback? changeCallback);
    
            void stop(MotionType type);
    
            void setAccumulativePedometerListener(MotionInfoSuccessCallback changeCallback);
    
            void unsetAccumulativePedometerListener(); 
    
            void startHandGestureRecognition (HandGestureInfoChangeCallback changeCallback, BodySide bodySide, RecognitionMode recognitionMode);
    
            void stopHandGestureRecognition(); 
        };
    
        [NoInterfaceObject] interface MotionInfo {
         };
    
        [NoInterfaceObject] interface MotionPedometerInfo : MotionInfo {
    
            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 MotionStepDifference[] stepCountDifferences;
        };
    
        [NoInterfaceObject] interface MotionAccumulativePedometerInfo : MotionInfo {
    
            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 MotionStepDifference[] stepCountDifferences;
        };
        
        [NoInterfaceObject] interface MotionHRMInfo : MotionInfo {
    
            readonly attribute long heartRate;
    
            readonly attribute long rRInterval;
        };
    
        [NoInterfaceObject] interface MotionGPSInfo {
    
            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 MotionGPSInfoArray  : MotionInfo {
    
            readonly attribute MotionGPSInfo[] gpsInfo;
        };
    
        [NoInterfaceObject] interface MotionHandGestureInfo : MotionInfo {
    
            readonly attribute HandGestureEvent gestureEvent;
    
            readonly attribute double acceleration;
    
            readonly attribute long durationTime;
        };
    
        [NoInterfaceObject] interface MotionStepDifference {
    
            readonly attribute long stepCountDifference;
    
            readonly attribute long timestamp;
        };
        
        [NoInterfaceObject] interface MotionActivityRecognitionInfo  : MotionInfo {
    
            readonly attribute ActivityRecognitionEvent activityEvent;
        };
    
        [Callback=FunctionOnly, NoInterfaceObject] interface MotionInfoSuccessCallback {
            void onsuccess(optional MotionInfo? motionInfo);
        };
    
        [Callback=FunctionOnly, NoInterfaceObject] interface HandGestureInfoChangeCallback {
            void onsuccess(optional MotionHandGestureInfo? gestureInfo);
        };    
    };