Barrie Galitzky Barrie Galitzky - 1 month ago 4
Android Question

How to use Activity Recognition to detect walking/running vs on_foot

In Google Play Services Activity Recognition there is


when ever I get an activity update for either walking or running I get

how do I differentiate?

I know it says that RUNNING and WALKING : "This is a sub-activity of ON_FOOT"

Thanks for your help.


I've observed similar behavior. My theory is that when you receive a ActivityRecognitionResult object, it will often contain several parseable DetectedActivity objects each with a confidence score specified by an integer. In the case of WALKING, there will be at least two DetectedActivity objects - one DetectedActivity object for ON_FOOT with a higher confidence level, and one DetectedActivity object for WALKING with a lower or equal confidence level.

In practice I imagine you'll often get some permutation of ON_FOOT + WALKING || RUNNING, or all three with varying confidence scores, with ON_FOOT likely being the highest.