app/src/main/java/com/michael/bci/ActivityRecognizedService.java
@Override
    protected void onHandleIntent(Intent intent) {
        if(ActivityRecognitionResult.hasResult(intent)) {
            ActivityRecognitionResult result = ActivityRecognitionResult.extractResult(intent);
            DetectedActivity mostProbableActivity = result.getMostProbableActivity();
            handleDetectedActivities( result.getProbableActivities() );

            // Get the type of activity
            int activityType = mostProbableActivity.getType();
            // Get the confidence percentage for the most probable activity
            int confidence = mostProbableActivity.getConfidence();
        }
    }
/*
    In the onHandleIntent() method of ActivityRecognizedService we validate that the received Intent contains
    activity recognition data and, if so, then extract the ActivityRecognitionResult from the Intent to see what
    activities the user might be performing by calling getProbableActivities() on the ActivityRecognitionResult
    object.
     */
In the onHandleIntent() method of ActivityRecognizedService we validate that the received Intent contains
activity recognition data and, if so, then extract the ActivityRecognitionResult from the Intent to see what
activities the user might be performing by calling getProbableActivities() on the ActivityRecognitionResult
object.
In the onHandleIntent () method of ActivityRecognizedService we validate that the received Intent contains activity recognition data and if so then extract the ActivityRecognitionResult from the Intent to see what activities the user might be performing by calling getProbableActivities () on the ActivityRecognitionResult object .
@Override
    protected void onHandleIntent(Intent intent) {
        if(ActivityRecognitionResult.hasResult(intent)) {
            ActivityRecognitionResult result = ActivityRecognitionResult.extractResult(intent);
            DetectedActivity mostProbableActivity = result.getMostProbableActivity();
            handleDetectedActivities( result.getProbableActivities() );
            int activityType = mostProbableActivity.getType();
            int confidence = mostProbableActivity.getConfidence();
        }
    }
@ Override protected void onHandleIntent ( Intent intent ) { if ( ActivityRecognitionResult . hasResult ( intent ) ) { ActivityRecognitionResult result = ActivityRecognitionResult . extractResult ( intent ) ; DetectedActivity mostProbableActivity = result . getMostProbableActivity ( ) ; handleDetectedActivities ( result . getProbableActivities ( ) ) ; int activityType = mostProbableActivity . getType ( ) ; int confidence = mostProbableActivity . getConfidence ( ) ; } }
In the onHandleIntent() method of ActivityRecognizedService we validate that the received Intent contains
activity recognition data and, if so, then extract the ActivityRecognitionResult from the Intent to see what
activities the user might be performing by calling getProbableActivities() on the ActivityRecognitionResult
object.
In the onHandleIntent () method of ActivityRecognizedService we validate that the received Intent contains activity recognition data and if so then extract the ActivityRecognitionResult from the Intent to see what activities the user might be performing by calling getProbableActivities () on the ActivityRecognitionResult object .
// Get the type of activity // Get the confidence percentage for the most probable activity