How can I update time and distance intervals or call the LocationUpdates request again at different intervals?
My code is:
LocationManager locationManager = (LocationManager) activityObject.getSystemService(Context.LOCATION_SERVICE); cll = new CheckinLocationListener(); LocationProvider gps = locationManager.getProvider(LocationManager.GPS_PROVIDER);
onLocationChanged:
if(location.getSpeed()>=0 && location.getSpeed()<= 3) { LocationsModel.this.distanceDelay = 25; LocationsModel.this.timeDelay = 10000; } else if(location.getSpeed()>=3 && location.getSpeed()<= 17) { LocationsModel.this.distanceDelay = 150; LocationsModel.this.timeDelay = 60000; } else if(location.getSpeed()>=17) { LocationsModel.this.distanceDelay = 300; LocationsModel.this.timeDelay = 240000; }
I would like to use new intervals in the following measure.
Mcdermott
source share