tm1701
tm1701

Reputation: 7591

Osmdroid MylocationNewOverlay - setting the location update frequency

Is there a way to set the location update frequency? And also for the minimum distance?

Reason: I would like to set it in relation to battery savings.

Upvotes: 2

Views: 1198

Answers (1)

kurtzmarc
kurtzmarc

Reputation: 3137

You can create your own instance of GpsMyLocationProvider and set those parameters.

GpsMyLocationProvider gpsLocationProvider = new GpsMyLocationProvider(context);
gpsLocationProvider.setLocationUpdateMinTime(...);
gpsLocationProvider.setLocationUpdateMinDistance(...);
mMyLocationNewOverlay.enableMyLocation(gpsLocationProvider);

Upvotes: 5

Related Questions