- I want to use google ActivityRecognition service in my android application.
- I've install google play services from SDK manager and add google_play_services_lib project to my project by import option and hitting "copy project to your workspace" checkbox.
- I'v been wrote a code according to this link: Android Activity Recognition not working with Nexus 5
My import list is as bellow:
import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.util.Log; import android.widget.Toast;
import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.GooglePlayServicesClient; import com.google.android.gms.common.GooglePlayServicesUtil; import com.google.android.gms.location.ActivityRecognitionClient;
public class MainActivity extends FragmentActivity implements GooglePlayServicesClient.ConnectionCallbacks,GooglePlayServicesClient.OnConnectionFailedListener {
My android project can resolve all import excepting com.google.android.gms.location.ActivityRecognitionClient!!!!
- I copied sample activityRecognition project from developer.android.com and open it from my eclipse but there is the same problem with ActivityRecognitionClient!!!
- I found a similar problem here: Imported Project in Android Studio can't resolve ActivityRecognnitionClient but not helpful for me.
Why eclipse can not resolve com.google.android.gms.location.ActivityRecognitionClient?
686 Views Asked by N. S. At
1
I've add the bellow 3 jar files into the libs directory of my project and the problem is solved!