Faster GPS fix in Android

I noticed that applications like GPS status are quickly fixed. When I try to get a fix in my own application, it takes more time. Does anyone know why this is happening? Do they use the hidden part of the API to speed up the GPS connection?

Here i use

LocationManager loc = (LocationManager) context .getSystemService(Context.LOCATION_SERVICE); loc.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, listener); 

I want the GPS to give results as often as possible, because I need this for the AR application :) Although I set the settings as 1000 ms and 1 m for the update frequency without a noticeable difference in the speed of correction.

+7
android gps
source share
2 answers

There may be one of several approaches:

  • Using LocationManager.getLastKnownLocation (which, given how many applications use location data, should usually be "close enough" if it's not dead exactly.)
  • Using LocationManager.NETWORK_PROVIDER instead of LocationManager.GPS_PROVIDER to get an immediate rough fix, refining with GPS (if available).
  • Running the service in the background, which periodically gets the last position and caches it (basically the same as LocationManager.getLastKnownLocation , but does it on its own)
+5
source share

Here is my strategy: check this answer in StackOverflow.

+3
source share

All Articles