I am trying to use activity recognition in a project to determine when a user is "IN-VEHICLE". (Driving) The problem is that it is almost impossible to use it, since mostProbableActivity often reports "IN-VEHICLE" even though I sit at my desk for a long time or just walk around in my house. It would be very nice to know how the API does this.
I think this feature has great potential, but since something is clearly not working right now.
This is the MostProbableActivity magazine, done every 30 seconds to show what I mean. Sitting at my desk, after 4 minutes I rotate the phone a couple of times, and this leads to the result "mostProbable IN-VEHICLE".
I tried different phones, and the result is the same. Therefore, I do not think that this is related to equipment.
DetectedActivity [type=STILL, confidence=43] DetectedActivity [type=STILL, confidence=54] DetectedActivity [type=STILL, confidence=100] DetectedActivity [type=STILL, confidence=100] DetectedActivity [type=STILL, confidence=69] DetectedActivity [type=STILL, confidence=100] DetectedActivity [type=STILL, confidence=92] DetectedActivity [type=TILTING, confidence=100] DetectedActivity [type=IN_VEHICLE, confidence=49] DetectedActivity [type=TILTING, confidence=100] DetectedActivity [type=STILL, confidence=51] DetectedActivity [type=STILL, confidence=100] DetectedActivity [type=STILL, confidence=100] DetectedActivity [type=STILL, confidence=85] DetectedActivity [type=STILL, confidence=100] DetectedActivity [type=STILL, confidence=66] DetectedActivity [type=STILL, confidence=100]
This is the code, nothing special:
public class ActivitiesIntentService extends IntentService { private static final String TAG = "ActivitiesIntentService"; public ActivitiesIntentService() { super(TAG); } @Override protected void onHandleIntent(Intent intent) { ActivityRecognitionResult result = ActivityRecognitionResult.extractResult(intent); Intent i = new Intent(Constants.STRING_ACTION); DetectedActivity mostProbableActivity = result.getMostProbableActivity(); i.putExtra("MOST_PROBABLE_ACTIVITY",mostProbableActivity); LocalBroadcastManager.getInstance(this).sendBroadcast(i); Log.e(TAG, String.valueOf(mostProbableActivity)); } }
From this link:
Activity Recognition API
I see that others have similar experiences, but some claim it works fine.
I think this is a mistake in the API trust algorithm. It is easy to conclude that the phone does not move in any direction or on the road, so it is clearly NOT the "mostProbable" in the VEHICLE.
Can anyone confirm this problem or use it incorrectly?
Best wishes
Thomas