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

Reply via email to