core-motion

iOS - is Motion Activity Enabled in Settings > Privacy > Motion Activity

谁说胖子不能爱 提交于 2019-11-27 04:07:12
问题 If an app requires access to Motion Activity data it asks the user at install. However if the user accidentally answers 'No', then the app will not work. I am looking for a way to check if the Motion Activity is enabled, so that I can prompt the user to enable if not. Can someone point me in the right direction code wise please? Following the info from Doc (Thank you), it seems that Apple do not provide a direct method to check the status of Motion Activity in Privacy. I was able to find out

DeviceMotion relative to world - multiplyByInverseOfAttitude

我只是一个虾纸丫 提交于 2019-11-27 02:24:43
问题 What is the correct way to use CMAttitude:multiplyByInverseOfAttitude? Assuming an iOS5 device laying flat on a table, after starting CMMotionManager with: CMMotionManager *motionManager = [[CMMotionManager alloc]init]; [motionManager startDeviceMotionUpdatesUsingReferenceFrame: CMAttitudeReferenceFrameXTrueNorthZVertical]; Later, CMDeviceMotion objects are obtained: CMDeviceMotion *deviceMotion = [motionManager deviceMotion]; I expect that [deviceMotion attitude] reflects the rotation of the

iOS detect movement of user

[亡魂溺海] 提交于 2019-11-27 01:41:47
问题 I want to create a simple app that draws a simple line on screen when I move my phone on the Y-axis from a start point to end point, for example from point a(0,0) to point b(0, 10) please help demo : 回答1: You need to initialize the motion manager and then check motion.userAcceleration.y value for an appropriate acceleration value (measured in meters / second / second). In the example below I check for 0.05 which I've found is a fairly decent forward move of the phone. I also wait until the

Simple iPhone motion detect

假装没事ソ 提交于 2019-11-26 22:11:52
I need to detect when the gyroscope / accelerometer is activated a certain amount. Basically to detect when there is movement of the device. I don't know anything about Core Motion. Maybe someone can direct me to a starters tutorial or something. Thanks in advance. I think you have to use Core Motion. The good news is that it is not that hard to use for your problem domain. Start reading the Event Handling Guide especially the section Handling Processed Device-Motion Data. If you are just interested in knowing that a slight motion was made, as you stated, you can omit rotation handling and

iPhone collecting CoreMotion data in the background. (longer than 10 mins)

*爱你&永不变心* 提交于 2019-11-26 19:30:54
问题 I am trying to collect coreMotion acceleration data in the background for longer than 10 minutes. This must be possible since apps like Sleep Cycle do this. I just want to make sure this is allowed though, since it does not seem to be one of these: Apps that play audible content to the user while in the background, such as a music player app Apps that record audio content while in the background. Apps that keep users informed of their location at all times, such as a navigation app Apps that

In iOS, what is the difference between the Magnetic Field values from the Core Location and Core Motion frameworks?

六眼飞鱼酱① 提交于 2019-11-26 18:46:52
问题 I have two ways of getting the magnetic fields (strength, x, y, and z) using the iOS device's magnetometer. 1) Core Location Used the CLHeading from CLLocationManagerDelegate method locationManager:didUpdateHeading: . This is similar to Apple's Teslameter sample app. 2) Core Motion Used CMMagneticField from CMMotionManager 's magnetometerData.magneticField . Questions: a) What is the difference between the two? I am getting different values from both. I was expecting that they will return the

Receive accelerometer updates in background using CoreMotion framework

南楼画角 提交于 2019-11-26 16:48:18
问题 I'm using the following code to get accelerometer data (using CoreMotion framework): CMMotionManager *motionManager = [[CMMotionManager alloc] init]; motionManager.accelerometerUpdateInterval = 1.0 / 60.0; [motionManager startAccelerometerUpdatesToQueue:[NSOperationQueue currentQueue] withHandler:^(CMAccelerometerData *accelerometerData, NSError *error) { NSLog(@"ACCELEROMETER DATA = %@",accelerometerData); }]; When the app is in foreground mode, I'm receiving the log, but when it enters

Simple iPhone motion detect

独自空忆成欢 提交于 2019-11-26 08:13:44
问题 I need to detect when the gyroscope / accelerometer is activated a certain amount. Basically to detect when there is movement of the device. I don\'t know anything about Core Motion. Maybe someone can direct me to a starters tutorial or something. Thanks in advance. 回答1: I think you have to use Core Motion. The good news is that it is not that hard to use for your problem domain. Start reading the Event Handling Guide especially the section Handling Processed Device-Motion Data. If you are