Best way to take GPS location

Hi guys,
i’m creating an app that track the GPS position (like a walking app) and save them into firebase database.
All work well but the GPS position is not very accurate.
i use google maps with the block “Get my location” but i see that there is also location sensor that the position.
what is the best way to take an accurate GPS position ?

Did You try ?

thanks but it is not what i search.
i make an example:
i run my app, i press a button that start to track my position.
i use the onLocationChange that save lat and long of my position in firebase database but the problem is that is too sensitive/inaccurate because when i’m stopped in a place a new lat and long are stored in the database.
i would that when i’m stopped in a place only one coordinate are stored in the database.

1 Like

Is this new latitude and longitude the same or different? Don’t you care if you’re new? Or do you want only N in N meters?

i’m stopped in a place, i’m not moving and this is the result in firebase:

that is the problem!
i want to save the coordinates only if i walking or running because each point will be a marker and when i’m stopped in a place i want only one marker.

If you put a condition to record in Firebase? Only record on Firebase if the difference between new and old latitude and longitude is greater than N?

something like this ?

this doesn’t work, have you another idea?

Perhaps because 0.001 is too small. See degrees and radians. And calculate how much each 0.001 radian in degrees means.
1 degree =1852m
1 degree = how many radians?

1 Like

i use this DistanceCalc : Calculate distance between two places from coordinates and now works perfectly !

1 Like

Don’t forget to mark which tip led you to the solution.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.