Skip to content Skip to sidebar Skip to footer

Android GPS. Location Listener Does Not Want To Acquire A Fix :(

Here is a code below that suppose to listen for GPS updates and send notifications to main activity However it does not seem to be working :) No errors, only onLocationChanged is n

Solution 1:

Ok, figure out that this is an issue that was also seen by other people: apparently (at least on some phones) GPS listener works much worse if Camera is active.

Problem with getting GPS data when using CameraPreview

Android: Losing GPS signal strength on some phones when I start up the Camera and SurfaceView

Camera Preview and GPS reading in Android

Created Andorid issue for that http://code.google.com/p/android/issues/detail?id=20098

If someone has a solution pls share


Solution 2:

Check for permissions in your projects AndroidManifest.xml file

<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>

Solution 3:

Where are you testing? Indoors? What providers are the other apps using? Network Provider?

My guess is that the apps that are working use Network provider and since you are getting the last known, it will return that location from the previous app location ping. The Network provider helps allocate gps satellites by giving a general location. So when you start app (after running other apps), you have satellites, but (since you are probably indoors) without the network you may lose satellites little by little, decreasing accuracy.

moral of the story: Use the network provider as well, or make sure you have clear view of the sky to test gps.


Post a Comment for "Android GPS. Location Listener Does Not Want To Acquire A Fix :("