I have download a demo project from http://developer.android.com/training/location/retrieve-current.html, and I think I don\'t lost any steps; But I can\'t find which jar fi
As Location Client is deprecated the class is no more found in the package. We have to use the following instead
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addApi(LocationServices.API)
.addConnectionCallbacks(new GoogleApiClient.ConnectionCallbacks(){
@Override
public void onConnected(Bundle arg0) {
// TODO Auto-generated method stub
LocationRequest request = new LocationRequest();
int priority = LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY;
if (enableHighAccuracy) {
priority = LocationRequest.PRIORITY_HIGH_ACCURACY;
}
request.setPriority(priority);
LocationServices.FusedLocationApi.requestLocationUpdates(
locationClient, request, new LocationListener() {
@Override
public void onLocationChanged(Location location) {
locationClient.disconnect();
}
});
}
@Override
public void onConnectionSuspended(int arg0) {
// TODO Auto-generated method stub
}
})
.addOnConnectionFailedListener(new GoogleApiClient.OnConnectionFailedListener() {
@Override
public void onConnectionFailed(ConnectionResult arg0) {
// TODO Auto-generated method stub
}
})
.build();