Reputation: 11
My requirement is to detect if a person is driving. I am a bit confused with the Google ActivityRecognitionApi documentation.
Does "IN_VEHICLE" mean that the vehicle is in motion or can it be a stationary as well.
Does Google ActivityRecognitionApi "IN_VEHICLE" use GPS along with accelerometer? If no, do we need to use GPS as well to detect if the vehicle is in motion?
Upvotes: 1
Views: 956
Reputation: 8122
Does "IN_VEHICLE" mean that the vehicle is in motion or can it be a stationary as well?
IN_VEHICLE
simply means that the device is in a vehicle, such as a car.Does Google ActivityRecognitionApi "IN_VEHICLE" use GPS along with accelerometer? If no, do we need to use GPS as well to detect if the vehicle is in motion?
This statement from the ActivityRecognitionApi documentation gives a clear answer on how activities are being recognized using the API:
The activities are detected by periodically waking up the device and reading short bursts of sensor data. It only makes use of low power sensors in order to keep the power usage to a minimum. For example, it can detect if the user is currently on foot, in a car, on a bicycle or still.
You may want to also check this article which focuses on using the Google Play Services Activity Recognition API to determine if the user is running, walking, in a vehicle, biking, or remaining still.
Lastly, with regards to the use of GPS and accelerometer, I suggest that you please check Motion Sensors documentation wherein it provides several sensors that let you monitor the motion of a device.
Upvotes: 1