I've tried a whole month to learn to use Google's Activity Recognition service, and met a very confusing problem while adding ActivityRecognition.API to mGoogleApiClient.
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(ActivityRecognition.API)
.build();
I'm given an error which says "Cannot resolve symbol 'ActivityRecognition'". Then I imported anything that looks related with ActivityRecognition like,
import com.google.android.gms.location.ActivityRecognitionClient
import com.google.android.gms.location.ActivityRecognitionResult
import com.google.android.gms.location.ActivityRecognitionResultCreator
import com.google.android.gms.location.DetectedActivity
and nothing worked. I can't even find a person who encountered this situation. Also, the official document shows ActivityRecognition is not deprecated.
Here is my screenshot. (Please ignore the underline of 'this'. That has been solved, and I'm pretty sure it has nothing to do with the 'ActivityRecognition' error. )
I'm using Android Studio 1.3.2 on Windows7 x64. I don't know if this information is necessary.
Activity Recognition will surly help a lot on my developing app. Sincerely hope someone could help me.