GPS location refresh rate extremely low

149 views Asked by At

I'm trying to access GPS data from androidhelper, but the 'location' events come at about 1 minute intervals. I'm testing in a Motorola e5, with Android 8. The basic code is:

import androidhelper
droid.androidhelper.Android()
droid.startLocating()
droid.eventWaitFor('location', int(9000))
location = droid.readLocation().result
print(location['gps']['latitude'])
print(location['gps']['longitude'])
droid.stopLocating()

With other apps, the GPS data refresh rate is about 1 second.

Is there any way to improve the refresh rate for androidhelper?

1

There are 1 answers

0
Herman D On

[https://kylelk.github.io/html-examples/androidhelper.html][1] I think it has to do with the defaults:

startLocating(minDistance=60000,minUpdateDistance=30) Starts collecting location data. minDistance (Integer) minimum time between updates in milliseconds (default=60000) minUpdateDistance (Integer) minimum distance between updates in meters (default=30)

If I reduce them it seems to be much faster.