How to compare accelerometer values ​​in iOS and Android

I get the accelerometer values ​​in iOS as follows

if (motionManager.accelerometerAvailable) {
        NSLog(@"Accelerometer avaliable");
        [motionManager startAccelerometerUpdatesToQueue:[NSOperationQueue currentQueue] withHandler:^(CMAccelerometerData *accelerometerData, NSError *error) {
            if (!error) {
                NSLog(@"raw_accel_X==%f,date=%@",accelerometerData.acceleration.x,[NSDate date]);
                NSLog(@"raw_accel_Y==%f,date=%@",accelerometerData.acceleration.y,[NSDate date]);
                NSLog(@"raw_accel_Z==%f,date=%@",accelerometerData.acceleration.z,[NSDate date]);

        }];

If I do not move Iphone, I get data between -1 and 1, if I do not move my Android device. I get values ​​around 9. What should I do to match the values ​​of the original accelerometer in iOS for Android? Any update on this?

+3
source share
1 answer

You need to understand how the iOS accelerometer works. The output is measured in gforces , and there is a lot of noise with the data, so you need to normalize the data before analyzing it.

Android , g-force, 9.81 ( ).

+3

Source: https://habr.com/ru/post/1759103/


All Articles