I’m working on an Android app that uses high-resolution GPS data. It’s designed to be used in a car, so I’m not too worried about battery life. I’ve noticed that when I run my app while the stock Google navigation app is running, my GPS data has accuracy within several (< 10) meters.
However, when I run my app without the navigation app, my location data starts off precise, but soon becomes poor (within 1000 m). I have my app in a PARTIAL_WAKE_LOCK so the CPU keeps running, but the screen can shut off.
Here’s how I’m requesting GPS location:
requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, GPSListener);
Does anyone know of a way to request data more precisely? The Android Docs claim this means there is no lower limit on the time or distance between separate GPS calls. But clearly the stock navigation app is doing something differently. Does anyone have any ideas? Thanks in advance.
You should use requestLocationUpdates
(long minTime, float minDistance, Criteria criteria, PendingIntent intent)
And set the criteria to ACCURACY_HIGH and some other options you may explore. If you are using the WiFi network too then you can also get the cell locations to provide more accuracy.