I would like to detect when the phone is in motion, but not all kind of motion. For example picking up or waving the phone should not trigger.
I would like ideally to run a code when the phone/person is in > "walking" state. What options I have?
I would like to detect when the phone is in motion, but not all kind of motion. For example picking up or waving the phone should not trigger.
I would like ideally to run a code when the phone/person is in > "walking" state. What options I have?
You can also get your location from Wifi-Networks and Cell Towers. All location providers in Android are subclasses of android.location.LocationProvider. That's probably a good place to start. I don't know that either of those would be best for you, as their "range" can be several hundreds of feet wide.
you can use a combination of the accelerometer and the digital compass, in phones that have them, to determine a speed and direction.
If all you need to do is determine if the person is walking, all you need is the accelerometer. Just process its output for foot steps.
There are plenty of tutorials on the web for detecting foot steps with an accelerometer.