getting the highest GPS update rate from the GPS Hardware in my Android

本秂侑毒 提交于 2019-12-21 03:52:38

问题


I got to program Android from other platforms I used with GPS . on the other platfroms I had access to the GPS HW (I had a low level GPS driver) and by that I could get GPS updates 5 times per second and even more Now I work with Samsung Galaxy S2 (which it is clear to me that its GPS is very strong and can supply several updates per second Currently when I set the GPS provider to supply updates in minimum distance and minimum time like this:

mlocManager.requestLocationUpdates( 
    LocationManager.GPS_PROVIDER, 0, 0, mlocListener
); 

I get 1 update per second (or 800ms as smallest gap between two updates) which is too low for my application. Is there a way to force the GPS HW to report more updates somehow ? I guess it is not exposed to the user but is there still some way to access the registers of the GPS HW somehow ?


回答1:


Currently you can't get updates faster than once per second in most of the phone.This is the hardware gps limit.

Usually in most of the phones,it is at 1hz.

It all depends on hardware and scenario where you are using ( Indoor,Outdoor)

But again, You could check using

LocationRequest setFastestInterval (long millis)

This allows your application to passively acquire locations at a rate faster than it actively acquires locations, saving power.

Unlike setInterval(long), this parameter is exact. Your application will never receive updates faster than this value.

This method sets the fastest rate in milliseconds at which your app can handle location updates. You need to set this rate because other apps also affect the rate at which updates are sent. Location Services sends out updates at the fastest rate that any app requested by calling LocationRequest.setInterval().

If this rate is faster than your app can handle, you may encounter problems with UI flicker or data overflow.



来源:https://stackoverflow.com/questions/17827142/getting-the-highest-gps-update-rate-from-the-gps-hardware-in-my-android

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!