I have an android service (in Java) that currently invokes a function that does things like getting geolocation coordinates when the user shakes the phone repeatedly.
However, to reduce false-positives, I would like to be able to listen to a combination of events -- a hardware button press (Volume down, for instance) along with a repeated shaking, which would then invoke the same function as above.