How to detect the iPhone fell on the ground using the UIAccelerometer
? I am using the following delegate to calculate the falling detection but it's not working correctly.
Is this calculation correct or not?
Please suggest any other type of detection.
Calculation : currentDeviceAcceleration = sqrt(9.81*x*x + 9.81*y*y + 9.81*z*z)
- (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration
{
float x = acceleration.x;
float y = acceleration.y;
float z = acceleration.z;
float currentDeviceAcceleration = sqrt(9.81*x*x + 9.81*y*y + 9.81*z*z);
if (currentDeviceAcceleration > 8.5) {
//Device felt on ground
}
}