0

I am using LocationManager to get the values of Latitude and Longitude of a user. These values are updated regularly to a database and find out the distance between two users basing on the stored Latitude and Longitude values.

Now,onLocationchanged() called very slow,some times get fast.while i'm waiting long time to proceed next process.When i 'm in indoor the Location search is very slow..

Is there any solution to this prob.pls give me a guide and example.

Please Accept My question as soon as give me a solution.

Selva
  • 839
  • 10
  • 25
  • 40
  • Once i had the same ques and i got the answer from this thread :http://stackoverflow.com/questions/3145089/what-is-the-simplest-and-most-robust-way-to-get-the-users-current-location-in-an – Nibha Jain Oct 03 '11 at 13:00
  • Did you try to call this function in a separated thread? – Yahor10 Oct 03 '11 at 12:52

3 Answers3

2

If you use network location provider, you will get location faster, but it will be less accurate (100-500m).

OTOH, GPS provider will be more accurate (10-20m) but it will take more time to acquire location as device needs to acquire GPS satellite signals. Sometimes it's not even possible to acquire signals, especially if indoor or beneath thick trees.

Peter Knego
  • 79,991
  • 11
  • 123
  • 154
  • thank u for ur reply.I was used GPS provider.now i will try to network provide.can u give me diff between these two.give me a example – Selva Oct 03 '11 at 13:01
0

Well there are there types of GPS starts :

COLD start: takes a lot of time. The old GPS (satellite/time) data is practically useless.

WARM start : is when the GPS device remembers its last calculated position, almanac used, and UTC Time, but not which satellites were in view. You get the fix fairly fast.

HOT start : is when the GPS device remembers its last calculated position and the satellites in view, the almanac used (information about all the satellites in the constellation), the UTC Time and makes an attempt to lock onto the same satellites and calculate a new position based upon the previous information.

To emulate the warm start case all you have to do is connect to the SUPL network, which provides assistance data. Even cold starts can be converted to a warm start. To make sure that SUPL networks are available, make sure you are connected to the internet. In indoor cases no satellites are visible so getting an exact fix is tough without any assistance data. At least 3 satellites should be visible. Again SUPL networks come to the rescue.

Note that, various GPS chipset have different performances/algorithms and the triangulation time depends on the SUPL networks provided by your Network provider.

You can here more about this here

Reno
  • 33,594
  • 11
  • 89
  • 102
  • As those methods are not available via Andoir-APIs, they are pretty useless in given context. – Konstantin Pribluda Feb 01 '12 at 12:03
  • They aren't officially, yes. But most major handset manufacturers support this using extra commands (which are a part of the Android API) – Reno Feb 01 '12 at 12:06
0

Good starting point is blog/project by Reto Meier:

http://code.google.com/p/android-protips-location/

Konstantin Pribluda
  • 12,329
  • 1
  • 30
  • 35