user1406716 user1406716 - 1 month ago 7x
Android Question

Always getting ON_FOOT from Google Awareness API Detection Activity. How to get sub-activity WALKING?

I am using the class DetectedActivity from the Google Awareness API. When I walk or run, I always get the response


For example, when I am just walking, I want to get back WALKING only but I still get ON_FOOT. I do see the following note in the documentation but it doesn't tell how to get the ON_WALKING sub-activity information too?

The device is on a user who is walking. This is a sub-activity of ON_FOOT.


You need to use getProbableActivities to get the full list of probable activities: while ON_FOOT will be the most probable activity, looking at the second most probably activity will return WALKING, RUNNING, etc.