tags:

views:

203

answers:

1

I want speed factor in my GPS application in android. I want to use both network provider and gps provider both to get location updates. But network provider hardly gives speed. While GPS provider provides fix many a times.

  1. But is it so that once a fix is found without speed, device will not request for new update until the interval or distance set in requestLocationUpdates changes ? If so, how can I enforce to continue it until I have speed. I found Criteria class, but we can use it only while choosing a provider. I want to use it while obtaining fix. Can I ?

  2. Another thing I noticed is sometimes I get speed to be 127 m/s at start, even I am steady then it normalizes to actual speed. Is this a problem of device (tested in G1), or is in general depending on satallite or location ?

  3. Does using Criteria while choosing provider, will not provide me location points that do not fit it ? Like if I set criteriaObj.setSpeedRequired(true) , then will I not get points if there is not such availble. As I require position update in any case.

Any suggestions ?

A: 

I think your questions about Android location based services are answered in a recent Google I/O session starting at slide 73 of 84 in the slide show pdf.

In particular, the session describes how to implement a back-off pattern that starts out with a lot of location listeners and removes listeners as accuracy improves (at which point your speed calculations would be believable).

gregS
Thanks for your reply. I gone through the slides for location based services, they do mention about back-off patterns. But this does not answer whether introducing more listeners for a particular provider (like GPS) will give me more accurate data. Is it so ? I mean if I have more listeners for suppose GPS provider will I get different updates in all of them. I believe one listener can collect all updates. Which one is true ?
mob_king
If your goal is to get the most accurate location data that is available, one listener won't do that. The slides are okay but are just an outline and not as informative as the video. Did you watch the discussion of criteria in the video?
gregS
No i did not watch video. But as you say ,i will watch it and try out and will comment on my results :)
mob_king
I watched the video for the last Location service section, but what it explains a typical scenario where once in some time we require to accurately have location data. For this the back-off pattern is good case as we turnoff listeners as we get more closer. But my application is a tracking app which has to be continously update, so this solution is not useful.I found some answers like it is clearly mention in API itself for setting time and distance to 0 for continous updates. While my network provider do not provide speed, which I confirmed from LocationProvider class methods.
mob_king