Class CMMotionManager

  • All Implemented Interfaces:
    NSObject

    public class CMMotionManager
    extends NSObject
    CMMotionManager Discussion: The CMMotionManager object is your entry point to the motion service.
    • Constructor Detail

      • CMMotionManager

        protected CMMotionManager​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(java.lang.String key)
      • availableAttitudeReferenceFrames

        public static long availableAttitudeReferenceFrames()
        availableAttitudeReferenceFrames Discussion: Returns a bitmask specifying the available attitude reference frames on the device.
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(java.lang.Object aTarget,
                                                                                 org.moe.natj.objc.SEL aSelector,
                                                                                 java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        public static org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • new_objc

        public static java.lang.Object new_objc()
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • version_static

        public static long version_static()
      • accelerometerData

        public CMAccelerometerData accelerometerData()
        accelerometerData Discussion: Returns the latest sample of accelerometer data, or nil if none is available.
      • accelerometerUpdateInterval

        public double accelerometerUpdateInterval()
        accelerometerUpdateInterval Discussion: The interval at which to deliver accelerometer data to the specified handler once startAccelerometerUpdatesToQueue:withHandler: is called. The units are in seconds. The value of this property is capped to certain minimum and maximum values. The maximum value is determined by the maximum frequency supported by the hardware. If sensitive to the interval of acceleration data, an application should always check the timestamps on the delivered CMAcceleration instances to determine the true update interval.
      • attitudeReferenceFrame

        public long attitudeReferenceFrame()
        attitudeReferenceFrame Discussion: If device motion is active, returns the reference frame currently in-use. If device motion is not active, returns the default attitude reference frame for the device. If device motion is not available on the device, the value is undefined.
      • deviceMotion

        public CMDeviceMotion deviceMotion()
        deviceMotion Discussion: Returns the latest sample of device motion data, or nil if none is available.
      • deviceMotionUpdateInterval

        public double deviceMotionUpdateInterval()
        deviceMotionUpdateInterval Discussion: The interval at which to deliver device motion data to the specified handler once startDeviceMotionUpdatesToQueue:withHandler: is called. The units are in seconds. The value of this property is capped to certain minimum and maximum values. The maximum value is determined by the maximum frequency supported by the hardware. If sensitive to the interval of device motion data, an application should always check the timestamps on the delivered CMDeviceMotion instances to determine the true update interval.
      • gyroData

        public CMGyroData gyroData()
        gyroData Discussion: Returns the latest sample of gyro data, or nil if none is available.
      • gyroUpdateInterval

        public double gyroUpdateInterval()
        gyroUpdateInterval Discussion: The interval at which to deliver gyro data to the specified handler once startGyroUpdatesToQueue:withHandler: is called. The units are in seconds. The value of this property is capped to certain minimum and maximum values. The maximum value is determined by the maximum frequency supported by the hardware. If sensitive to the interval of gyro data, an application should always check the timestamps on the delivered CMGyroData instances to determine the true update interval.
      • isAccelerometerActive

        public boolean isAccelerometerActive()
        accelerometerActive Discussion: Determines whether the CMMotionManager is currently providing accelerometer updates.
      • isAccelerometerAvailable

        public boolean isAccelerometerAvailable()
        accelerometerAvailable Discussion: Determines whether accelerometer is available.
      • isDeviceMotionActive

        public boolean isDeviceMotionActive()
        deviceMotionActive Discussion: Determines whether the CMMotionManager is currently providing device motion updates.
      • isDeviceMotionAvailable

        public boolean isDeviceMotionAvailable()
        deviceMotionAvailable Discussion: Determines whether device motion is available using any available attitude reference frame.
      • isGyroActive

        public boolean isGyroActive()
        gyroActive Discussion: Determines whether the CMMotionManager is currently providing gyro updates.
      • isGyroAvailable

        public boolean isGyroAvailable()
        gyroAvailable Discussion: Determines whether gyro is available.
      • isMagnetometerActive

        public boolean isMagnetometerActive()
        magnetometerActive Discussion: Determines whether the CMMotionManager is currently providing magnetometer updates.
      • isMagnetometerAvailable

        public boolean isMagnetometerAvailable()
        magnetometerAvailable Discussion: Determines whether magetometer is available.
      • magnetometerData

        public CMMagnetometerData magnetometerData()
        magnetometerData Discussion: Returns the latest sample of magnetometer data, or nil if none is available.
      • magnetometerUpdateInterval

        public double magnetometerUpdateInterval()
        magnetometerUpdateInterval Discussion: The interval at which to deliver magnetometer data to the specified handler once startMagnetometerUpdatesToQueue:withHandler: is called. The units are in seconds. The value of this property is capped to certain minimum and maximum values. The maximum value is determined by the maximum frequency supported by the hardware. If sensitive to the interval of magnetometer data, an application should always check the timestamps on the delivered CMMagnetometerData instances to determine the true update interval.
      • setAccelerometerUpdateInterval

        public void setAccelerometerUpdateInterval​(double value)
        accelerometerUpdateInterval Discussion: The interval at which to deliver accelerometer data to the specified handler once startAccelerometerUpdatesToQueue:withHandler: is called. The units are in seconds. The value of this property is capped to certain minimum and maximum values. The maximum value is determined by the maximum frequency supported by the hardware. If sensitive to the interval of acceleration data, an application should always check the timestamps on the delivered CMAcceleration instances to determine the true update interval.
      • setDeviceMotionUpdateInterval

        public void setDeviceMotionUpdateInterval​(double value)
        deviceMotionUpdateInterval Discussion: The interval at which to deliver device motion data to the specified handler once startDeviceMotionUpdatesToQueue:withHandler: is called. The units are in seconds. The value of this property is capped to certain minimum and maximum values. The maximum value is determined by the maximum frequency supported by the hardware. If sensitive to the interval of device motion data, an application should always check the timestamps on the delivered CMDeviceMotion instances to determine the true update interval.
      • setGyroUpdateInterval

        public void setGyroUpdateInterval​(double value)
        gyroUpdateInterval Discussion: The interval at which to deliver gyro data to the specified handler once startGyroUpdatesToQueue:withHandler: is called. The units are in seconds. The value of this property is capped to certain minimum and maximum values. The maximum value is determined by the maximum frequency supported by the hardware. If sensitive to the interval of gyro data, an application should always check the timestamps on the delivered CMGyroData instances to determine the true update interval.
      • setMagnetometerUpdateInterval

        public void setMagnetometerUpdateInterval​(double value)
        magnetometerUpdateInterval Discussion: The interval at which to deliver magnetometer data to the specified handler once startMagnetometerUpdatesToQueue:withHandler: is called. The units are in seconds. The value of this property is capped to certain minimum and maximum values. The maximum value is determined by the maximum frequency supported by the hardware. If sensitive to the interval of magnetometer data, an application should always check the timestamps on the delivered CMMagnetometerData instances to determine the true update interval.
      • setShowsDeviceMovementDisplay

        public void setShowsDeviceMovementDisplay​(boolean value)
        showsDeviceMovementDisplay Discussion: When the device requires movement, showsDeviceMovementDisplay indicates if the system device movement display should be shown. Note that when device requires movement, CMErrorDeviceRequiresMovement is reported once via CMDeviceMotionHandler. By default, showsDeviceMovementDisplay is NO.
      • showsDeviceMovementDisplay

        public boolean showsDeviceMovementDisplay()
        showsDeviceMovementDisplay Discussion: When the device requires movement, showsDeviceMovementDisplay indicates if the system device movement display should be shown. Note that when device requires movement, CMErrorDeviceRequiresMovement is reported once via CMDeviceMotionHandler. By default, showsDeviceMovementDisplay is NO.
      • startAccelerometerUpdates

        public void startAccelerometerUpdates()
        startAccelerometerUpdates Discussion: Starts accelerometer updates with no handler. To receive the latest accelerometer data when desired, examine the accelerometerData property.
      • startAccelerometerUpdatesToQueueWithHandler

        public void startAccelerometerUpdatesToQueueWithHandler​(NSOperationQueue queue,
                                                                CMMotionManager.Block_startAccelerometerUpdatesToQueueWithHandler handler)
        startAccelerometerUpdatesToQueue:withHandler: Discussion: Starts accelerometer updates, providing data to the given handler through the given queue. Note that when the updates are stopped, all operations in the given NSOperationQueue will be cancelled.
      • startDeviceMotionUpdates

        public void startDeviceMotionUpdates()
        startDeviceMotionUpdates Discussion: Starts device motion updates with no handler. To receive the latest device motion data when desired, examine the deviceMotion property. Uses the default reference frame for the device. Examine CMMotionManager's attitudeReferenceFrame to determine this.
      • startDeviceMotionUpdatesToQueueWithHandler

        public void startDeviceMotionUpdatesToQueueWithHandler​(NSOperationQueue queue,
                                                               CMMotionManager.Block_startDeviceMotionUpdatesToQueueWithHandler handler)
        startDeviceMotionUpdatesToQueue:withHandler: Discussion: Starts device motion updates, providing data to the given handler through the given queue. Uses the default reference frame for the device. Examine CMMotionManager's attitudeReferenceFrame to determine this.
      • startDeviceMotionUpdatesUsingReferenceFrame

        public void startDeviceMotionUpdatesUsingReferenceFrame​(long referenceFrame)
        startDeviceMotionUpdatesUsingReferenceFrame: Discussion: Starts device motion updates with no handler. To receive the latest device motion data when desired, examine the deviceMotion property. The specified frame will be used as reference for the attitude estimates.
      • startDeviceMotionUpdatesUsingReferenceFrameToQueueWithHandler

        public void startDeviceMotionUpdatesUsingReferenceFrameToQueueWithHandler​(long referenceFrame,
                                                                                  NSOperationQueue queue,
                                                                                  CMMotionManager.Block_startDeviceMotionUpdatesUsingReferenceFrameToQueueWithHandler handler)
        startDeviceMotionUpdatesUsingReferenceFrame:toQueue:withHandler Discussion: Starts device motion updates, providing data to the given handler through the given queue. The specified frame will be used as reference for the attitude estimates.
      • startGyroUpdates

        public void startGyroUpdates()
        startGyroUpdates Discussion: Starts gyro updates with no handler. To receive the latest gyro data when desired, examine the gyroData property.
      • startGyroUpdatesToQueueWithHandler

        public void startGyroUpdatesToQueueWithHandler​(NSOperationQueue queue,
                                                       CMMotionManager.Block_startGyroUpdatesToQueueWithHandler handler)
        * startGyroUpdatesToQueue:withHandler: * * Discussion: * Starts gyro updates, providing data to the given handler through the given queue. * Note that when the updates are stopped, all operations in the * given NSOperationQueue will be cancelled.
      • startMagnetometerUpdates

        public void startMagnetometerUpdates()
        startMagnetometerUpdates Discussion: Starts magnetometer updates with no handler. To receive the latest magnetometer data when desired, examine the magnetometerData property.
      • stopAccelerometerUpdates

        public void stopAccelerometerUpdates()
        stopAccelerometerUpdates Discussion: Stop accelerometer updates.
      • stopDeviceMotionUpdates

        public void stopDeviceMotionUpdates()
        stopDeviceMotionUpdates Discussion: Stops device motion updates.
      • stopGyroUpdates

        public void stopGyroUpdates()
        stopGyroUpdates Discussion: Stops gyro updates.
      • stopMagnetometerUpdates

        public void stopMagnetometerUpdates()
        stopMagnetometerUpdates Discussion: Stops magnetometer updates.