I want to detect whether the phone is moving or just is shaked by people by using phone's sensor.But the sensor's result is very sensitive, its hard to distinguish between moving or shaking by orientation sensor or acceleration sensor and using some mathematic methods?
thanks a lot!
I'm not sure I understand the question - it sounds like you're trying to differentiate between the GPS and accelerometer? They're two different devices...
If you are trying to detect a distinct shake, i recommend using the accelerometer. Then, it is just a matter of detecting minimum speed with onSensorChanged().
The first search result on google for "android detect shake" brings me this: http://www.clingmarks.com/?p=25
Enjoy and please use search functions here and in google first before posting a thread.