Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

android

gps

rate

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 ?

like image 210
user2610687 Avatar asked Jul 24 '13 06:07

user2610687


People also ask

Why is my phone GPS inaccurate?

According to Google's new policy, smartphones running Android 10 are required to grant GPS permission for relevant apps to be provided with location data. Your GPS info may be inaccurate when your device screen is turned off depending on which option you selected in App permissions.


1 Answers

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.

like image 130
Jambaaz Avatar answered Oct 21 '22 07:10

Jambaaz