I am new to android. I want to get GPS locations at an interval of 3 minutes, but I'm getting location updates on every second.
How can I avoid this?
Please suggest something. I'm using the following code:
captureFrequencey=3*60*1000;
LocationMngr.requestLocationUpdates(
LocationManager.GPS_PROVIDER, captureFrequencey, 0, this);
LocationMngr.requestLocationUpdates(LocationManager.GPS_PROVIDER, captureFrequencey, 0, this);
Thats because you set the minimum distance to 0. Change it to 100 meters and check!
LocationMngr.requestLocationUpdates(LocationManager.GPS_PROVIDER, captureFrequencey, 100, this);
Refer to the documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With