Android: Frequency of location updates from location manager
Apologies if this is a very mundane or simple issue.
I wrote a location listener class for my开发者_运维知识库 android device and set the requestupdate as follows:
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this);
I see the GPS icon come up, blink and then hold steady. In my log, I see location updates, but the problem is there are very few updates, maybe once in 30 seconds or once a minute sometimes (while driving in my car).
Is this normal? Is there any way to get a higher frequency?
Well, as far as i know it depends on the phone, signal and the accuracy that you request...
Criteria locationCriteria = new Criteria();
locationCriteria.setAccuracy(Criteria.ACCURACY_FINE);
lm.requestLocationUpdates(lm.getBestProvider(locationCriteria, true), 0, 0, currentLocationListener);
Here's the code i used, it worked pretty fast on my phone.
精彩评论