title: ActivityRecognitionClient of activity Recognition cannot resolve ,error in android
body: <p>I am trying to use <code>ActivityRecognition</code> in android to detect whether the user is driving or not.</p>
  
  <p><a href="http://www.kpbird.com/2013/07/android-activityrecognition-example.html" rel="nofollow">http://www.kpbird.com/2013/07/android-activityrecognition-example.html</a>: This is an example code I have been trying...   </p>
  
  <p>But when I write <code>ActivityRecognitionClient  client;</code>  my IDE(Android Studio) says it cannot resolve it, and marks it red, but <code>ActivityRecognition</code> is resolved.   </p>
  
  <p>So I manually imported <code>com.google.android.gms.location.ActivityRecognitionClient;</code>, but it was also marked as red, I have already installed all the google Api's and playservices,  </p>
  
  <p>Please help me to get through! :)</p>
  
  <p>This is my Gradle.</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
  compileSdkVersion "Google Inc.:Google APIs:21"
  buildToolsVersion "21.1.1"
  
  defaultConfig {
      applicationId "interrupt.smart.com.smartinterrupt"
      minSdkVersion 16
      targetSdkVersion 21
      versionCode 1
      versionName "1.0"
  }
   buildTypes {
      release {
          minifyEnabled false
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
      }
  }
  }
  
  dependencies {
  compile fileTree(dir: 'libs', include: ['*.jar'])
  
  
  compile 'com.android.support:cardview-v7:21.0.+'
  compile 'com.android.support:recyclerview-v7:21.0.+'
  compile 'com.android.support:appcompat-v7:21.0.+'
  compile 'com.google.android.gms:play-services:6.5.87'
  
  compile 'com.google.android.gms:play-services-location:6.5.87'
  }
  </code></pre>