Activity Recognition API

前端 未结 4 845
醉酒成梦
醉酒成梦 2021-01-31 11:32

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

4条回答
  •  轮回少年
    2021-01-31 12:08

    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.

提交回复
热议问题