I'm trying to use google play service to get the user's position. The problem is this, I have dynamic time interval for sending this position to the server. However, LocationClient does not respect this interval, regardless of the value it has, the position update occurs in a fixed interval of 5 s.
Could anyone help me?
The code:
private LocationClient locationClient;
public void iniciarBusca(long updateInterval, long fastestInterval) {
mLocationRequest = LocationRequest.create();
mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
mLocationRequest.setInterval(updateInterval);
mLocationRequest.setFastestInterval(fastestInterval);
locationClient = new LocationClient(activity, this, this);
locationClient.connect();
}
public void disconectar() {
try {
locationClient.disconnect();
} catch (Exception e) {
}
}