Android detects gps location every 10 minutes

Android: I use the gps flag in my application whose user checks this, we use the user's gps location.

Now I have to make changes, if the user selects this checkbox, we use the gps location, and if the user remains in this checkbox, we must determine the user's location every 10 minutes, and if the location is different, we need to tell the user that this location is changing and if the user wants to use the new location.

any idea like an appy listner that fires every 10 minutes and stops after locating? any good idea to implement it just wants you guys to understand.

+3
source share
2 answers

You can try to implement a service that runs in the background, which can make a call once every 10 minutes and update the application about changes

+1
source

u can determine your configured minimum time between two location updates this is here // Register a listener using the location manager to receive location updates locationManager.requestLocationUpdates (LocationManager.NETWORK_PROVIDER, mintime, 0, locationListener); u can provide your own mintime

0
source

Source: https://habr.com/ru/post/1761868/


All Articles