FYI minDistance cannot be guaranteed to work the way you want: it may fire sooner (or perhaps later), it's more of a guide than a hard parameter. (In fact, before additional CTS testing, I believe it was sometimes disregarded entirely, because of a bug in some devices, this was for certain with minTime...)
I'm not sure what you mean by "most efficient?" If you app is listening for updates, it's going to be alive, which means it's going to take memory. It's a sort of misconception that requesting updates less frequently dramatically reduces your energy footprint, this isn't quite the case (given only my playing around with things, though). Keep in mind that your app could just die after a while. kris On Fri, Dec 14, 2012 at 2:07 PM, [email protected] <[email protected]> wrote: > I'm converting some of my Windows Phone apps to Android. The apps all > revolve around movement tracking. In WP7 the location watcher has a > "MovementThreshold" property that sets how much movement is necessary for > the GPS to trigger a movement event. Typically we want a lower threshold > when walking and a higher one when in a jet airplane. It can be throttled > with code like this that changes it every time we get movement if the speed > changes. > if (mph < 7) watcher.MovementThreshold = 5; > else if (mph < 15) watcher.MovementThreshold = 20; > else if (mph < 30) watcher.MovementThreshold = 100; > else if (mph < 50) watcher.MovementThreshold = 400; > else if (mph < 100) watcher.MovementThreshold = 800; > else if (mph < 120) watcher.MovementThreshold = 1200; > else if (mph < 200) watcher.MovementThreshold = 2400; > else if (mph < 400) watcher.MovementThreshold = 4800; > else watcher.MovementThreshold = 9000; > > Currently in my Android version of my app I make the following call one time > when my location service starts... > locMgr.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locLstnr); > > That 3rd parameter is minDistance (now set to zero) which sounds very much > like MovementThreshold in WP7. > > My first question is: Can I throttle minDistance in my Android app the same > way I throttle MovementThreshold in my WP7 app? > My second question is: What kind of call would be most efficient to do the > throtting? - would I just repeat the above requestLocationUpdates call > changing the minDistance parameter? > Thanks, Gary > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

