tufanv Expert Licensed User Longtime User Aug 10, 2016 #1 Hello I am using background location tracking. What I want to do is , to stop the backgorund tracking after some time if speed is less than 10. When I use locationchanged event to track the speed in the background, I saw that when there is no location change , the event not firing ( normally) so i cant measure the time correctly. IS there an easy way to stop the backgorund tracking if there is no movement for example for 5 minutes ? ( As I understand , using allowpauselocationautomaticly make prolems so there must be a way to do that ) edit: I also tried to use allowpause but the location tracking is not pausing even after 30 minutes altough i set the activity type to = 2 which is automativenavigation. I changed the code to allowpuase like this : Code: Copy Dim no As NativeObject = locmanager no = no.GetField("manager") no.SetField("pausesLocationUpdatesAutomatically", True) AllowPauseLocationAutomatically(locmanager,2) StartBackground(locmanager, 0) 'replaces locManager.Start locmanager.StartHeading TY Last edited: Aug 10, 2016
Hello I am using background location tracking. What I want to do is , to stop the backgorund tracking after some time if speed is less than 10. When I use locationchanged event to track the speed in the background, I saw that when there is no location change , the event not firing ( normally) so i cant measure the time correctly. IS there an easy way to stop the backgorund tracking if there is no movement for example for 5 minutes ? ( As I understand , using allowpauselocationautomaticly make prolems so there must be a way to do that ) edit: I also tried to use allowpause but the location tracking is not pausing even after 30 minutes altough i set the activity type to = 2 which is automativenavigation. I changed the code to allowpuase like this : Code: Copy Dim no As NativeObject = locmanager no = no.GetField("manager") no.SetField("pausesLocationUpdatesAutomatically", True) AllowPauseLocationAutomatically(locmanager,2) StartBackground(locmanager, 0) 'replaces locManager.Start locmanager.StartHeading TY
tufanv Expert Licensed User Longtime User Aug 10, 2016 #2 Edit: After further tests , I realized that AllowPauseLocationAutomatically works. If no location change for 20 minutes it stops background tracking. Upvote 0
Edit: After further tests , I realized that AllowPauseLocationAutomatically works. If no location change for 20 minutes it stops background tracking.