Anyone have trouble with the Activity Recognition API in the recent Google Play Services update?
I have it implemented in an app. It was working perfectly fine before th
You could try this simple ‘for loop’ to be sure that your user is driving.
for (DetectedActivity detectedActivity : detectedActivityList)
{
{
if(DetectedActivity == “In_Vehicle” && result.getConfidence()> 75)
{
// output = User is Driving;
// Perform task
}
}
}
Remember, for Google Play services to be sure that your user is performing a certain task, the confidence level must be greater than 75, only then you can be certain that the task is performed. Alternatively, you can try some of these free SDKs like Tranql, Neura or ContextHub which can give you better insights about your user’s activities and locations.