I'm trying to get my game working on Android. I've ported it with the free version of Apportable and it works quite well, but I haven't been able to implement the gyroscope feature.
CMMotionManager
gets initialized but the motion updates never start (or at least handleDeviceMotion:
never gets called). The motion manager's isAccelerometerActive
property is always NO, but isAccelerometerAvailable
is YES.
Using [NSOperationQueue mainQueue]
doesn't help either.
This is how I initialize the motion manager:
self.motionManager = [[CMMotionManager alloc] init];
self.motionManager.gyroUpdateInterval = .2;
[self.motionManager startDeviceMotionUpdatesToQueue:[[NSOperationQueue alloc] init]
withHandler:^(CMDeviceMotion *motion, NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{
[self handleDeviceMotion:motion];
});
}];
It produces the following message to logcat:
E/Sensors ( 507): HAL:ERR open file /sys/bus/iio/devices/iio:device0/dmp_event_int_on to write with error 2
E/Sensors ( 507): HAL:ERR can't disable DMP event interrupt
I have no idea what this means... I'm testing the app on Asus Nexus 7.
Is there something special I need to do to use CoreMotion with Apportable?
Edit: Here's a simple test project I created to demonstrate the issue.