Unfortunately, GPS motion alone won't trigger activity detection. Google factors in your accelerometer and other instruments to calculate the most probable activity, and if the accelerometer shows no change, it will always just say you're STILL
.
Google's official location testing docs say:
Mock locations have no effect on the activity recognition algorithm used by Location Services. To learn more about activity recognition, see the lesson Recognizing the User's Current Activity.
Unfortunately, that link has no information whatsoever about testing.
The only effective workaround I've found is to open the Virtual Sensors menu on the Android emulator and manually do something like yaw back and forth (see screenshot, just drag the "Yaw" dot back and forth and watch the phone tilt on your screen). For me this often results in a (low probability) detection of IN_VEHICLE
or UNKNOWN
after a while when paired with GPS mocking.