I am using the standard location setup
- Code: Select all
String context = Context.LOCATION_SERVICE;
locationManager = (LocationManager) getSystemService(context);
Location location = locationManager.getLastKnownLocation(provider);
locationManager.requestLocationUpdates(locationManager.GPS_PROVIDER, 0, 0, locationListener);
I then save the location to the database inside the updateWithNewLocation() method. I tried writing a Runnable to run every 5 seconds which would save the location but this resulted in every 2-3 locations in the database being the same because the location had not updated yet.
So it seems like I have two choices here.
1. Figure out how to force the Android core system to update the location more frequently. This would be the preferred method as I don't really want to log multiple points if I am sitting still.
2. Write my own Bluetooth NMEA provider and feed it into my program. This seems like the most control but I have no idea where to even start on this task and I would rather not reinvent the wheel if I don't have to.
Does anyone have any ideas on how I could force faster updates or have another method of receiving locations besides what I posted above? There must be a way to do this, if you look at apps like "GPS Test" or "GPS Status" the locations update much faster than what I am seeing.