You can find some better solutions seaching online. I think the issue is
that accelerometers basically sense acceleration, that is, how much the
velocity (meters/second) increases or decreases per second. Tapping the
phone creates a large instantaneous acceleration. So does the phone's
vibrator. I would say a shake is a sequence of high velocities over a
certain min-max time window, that alternate in direction a certain number of
times. The time derivative of that motion is what the accelerometer would
see. You can either integrate the sampled accelerometer output and filter
the resultant sampled velocities, or create a filter directly on the sampled
accelerometer output. In either case, it's helpful to look at a plot of the
values you are trying to filter. I'm suprised there isn't standard library
code for this in the SDK.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to