How Nike+ GPS on iPhone receives accelerometer updates in the background?

For the sake of providing an answer to this question, even though it is already self answered… “If you use the newer Core Motion API, you can receive updates in the background.” Here is an example: – (void)startAccelerationCollection { [self.motionManager startAccelerometerUpdatesToQueue:[[NSOperationQueue alloc] init] withHandler:^(CMAccelerometerData *data, NSError *error) { dispatch_async(dispatch_get_main_queue(), ^{ [self.accelerometerReadings addObject:data]; }); }]; }

Distance moved by Accelerometer

You get position by integrating the linear acceleration twice but the error is horrible. It is useless in practice. Here is an explanation why (Google Tech Talk) at 23:20. I highly recommend this video. However the gyro mouse might work for your application, see between 37:00-38:25 in the video. Similar questions: track small movements of … Read more

Android TYPE_LINEAR_ACCELERATION sensor – what does it show?

Very interesting question!!!! I’m developing somethig similar to your application. What i found about TYPE_LINEAR_ACCELERATION isn’t happy for me. 1) TYPE_LINEAR_ACCELERATION, TYPE_GRAVITY, ecc are implemented only for Android 2.3 (and up) So i have Android 2.2 and i can’t test them. 2) TYPE_LINEAR_ACCELERATION isn’t so accurate as it would be, because there are some simple … Read more

Detect change in orientation using javascript

NOTE: orientationChange is deprecated Instead use screen.orientation using the screenOrientation interface var orientation = (screen.orientation || {}).type || screen.mozOrientation || screen.msOrientation; if (orientation === “landscape-primary”) { console.log(“That looks good.”); } else if (orientation === “landscape-secondary”) { console.log(“Mmmh… the screen is upside down!”); } else if (orientation === “portrait-secondary” || orientation === “portrait-primary”) { console.log(“Mmmh… you … Read more

How to use Accelerometer to measure distance for Android Application Development

You get position by integrating the linear acceleration twice but the error is horrible. It is useless in practice. Here is an explanation why (Google Tech Talk) at 23:20. I highly recommend this video. Similar questions: track small movements of iphone with no GPS What is the real world accuracy of phone accelerometers when used … Read more

Indoor Positioning System based on Gyroscope and Accelerometer

Gyros and accelerometers are not enough. You get position by integrating the linear acceleration twice but the error is horrible. It is useless in practice. Here is an explanation by (Google Tech Talk) at 23:20. I highly recommend this video. As for indoor positioning, I have found these useful: RSSI-Based Indoor Localization and Tracking Using … Read more