Android Google Awareness APIs Get current user activity using Snapshot API

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!


For one-time, non-constant requests for a user's physical activity, use the Snapshot API:

// Remember to initialize your client as described in the Remarks section
    .setResultCallback(new ResultCallback<DetectedActivityResult>() {
        public void onResult(@NonNull DetectedActivityResult detectedActivityResult) {
            if (!detectedActivityResult.getStatus().isSuccess()) {
                Log.e(getClass().getSimpleName(), "Could not get the current activity.");
            ActivityRecognitionResult result = detectedActivityResult
            DetectedActivity probableActivity = result.getMostProbableActivity();
            Log.i(getClass().getSimpleName(), "Activity received : " + 

Got any Android Question?