开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜