app/src/main/java/com/michael/bci/MainActivity.java
@Override
    public void onConnected(@Nullable Bundle bundle) {
        /* Before request API request, GoogleApiClient must be in connected mode */
        Intent intent = new Intent(this,ActivityRecognizedService.class);
        PendingIntent pendingIntent = PendingIntent.getService(this,1,intent,PendingIntent.FLAG_UPDATE_CURRENT);
        ActivityRecognition.ActivityRecognitionApi.requestActivityUpdates(mApiClient,10000, pendingIntent);
        //ActivityRecognitionClient activityRecognitionClient = ActivityRecognition.getClient(this);
        //activityRecognitionClient.requestActivityUpdates(1000, pendingIntent);
    }
/*
    Once the GoogleApiClient instance has connected on onCreate above, this onConnected() is called and
    we create a PendingIntent that goes to the IntentService created in the ActivityRecognizedService class,
    and passes it to the ActivityRecognitionApi. We can set an interval for how often the API should check
    the user's activity e.g. value of 1000, or one second.
     */
Once the GoogleApiClient instance has connected on onCreate above, this onConnected() is called and
we create a PendingIntent that goes to the IntentService created in the ActivityRecognizedService class,
and passes it to the ActivityRecognitionApi. We can set an interval for how often the API should check
the user's activity e.g. value of 1000, or one second.
Once the GoogleApiClient instance has connected on onCreate above this onConnected () is called and we create a PendingIntent that goes to the IntentService created in the ActivityRecognizedService class and passes it to the ActivityRecognitionApi . We can set an interval for how often the API should check the user ' s activity e . g . value of 1000 or one second .
@Override
    public void onConnected(@Nullable Bundle bundle) {
        /* Before request API request, GoogleApiClient must be in connected mode */
        Intent intent = new Intent(this,ActivityRecognizedService.class);
        PendingIntent pendingIntent = PendingIntent.getService(this,1,intent,PendingIntent.FLAG_UPDATE_CURRENT);
        ActivityRecognition.ActivityRecognitionApi.requestActivityUpdates(mApiClient,10000, pendingIntent);
    }
@ Override public void onConnected ( @ Nullable Bundle bundle ) { /* Before request API request, GoogleApiClient must be in connected mode */ Intent intent = new Intent ( this , ActivityRecognizedService . class ) ; PendingIntent pendingIntent = PendingIntent . getService ( this , 1 , intent , PendingIntent . FLAG_UPDATE_CURRENT ) ; ActivityRecognition . ActivityRecognitionApi . requestActivityUpdates ( mApiClient , 10000 , pendingIntent ) ; }
Once the GoogleApiClient instance has connected on onCreate above, this onConnected() is called and
we create a PendingIntent that goes to the IntentService created in the ActivityRecognizedService class,
and passes it to the ActivityRecognitionApi.
Once the GoogleApiClient instance has connected on onCreate above this onConnected () is called and we create a PendingIntent that goes to the IntentService created in the ActivityRecognizedService class and passes it to the ActivityRecognitionApi .
//ActivityRecognitionClient activityRecognitionClient = ActivityRecognition.getClient(this); //activityRecognitionClient.requestActivityUpdates(1000, pendingIntent);