I want to get accurate vehicle speed through GPS without using internet or mobile data in Android. Is it possible to get accurate vehicle speed when mobile data and wifi are off but the GPS is ON?
Asked
Active
Viewed 131 times
-4
-
1what have you tried so far? can you please add any attempts made? – mast3rd3mon Jul 18 '18 at 13:53
-
I am using alarm manager for 30 seconds. On every 30 second I am calling LocationServices.FusedLocationApi.requestLocationUpdates. When I get response on onLocationChanged, I store current location on shared pref, Also I am using distanceTo method to get distance between current location and previous shared pref location then using distance formula to get speed. – Ishaq Ahmed Khan Jul 18 '18 at 14:05
1 Answers
0
Is it possible?
Yes.
Is it acurate?
Depends on what you define as acurate. But I would say rather not.
Approach
location.getSpeed()
Check this out: Determining the speed of a vehicle using GPS in android

Philipp
- 468
- 3
- 24
-
-
You are doing the calculation manual by now. This seems to work. Is too inaccurate for you? There are some tweaks in the documentation: https://developer.android.com/guide/topics/location/strategies – Philipp Jul 18 '18 at 14:14
-
Actually I am not getting accurate location by using GPS and without using wifi and mobile data. – Ishaq Ahmed Khan Jul 18 '18 at 14:25
-
This should be possible. If you share your code (in your question) someone can have a look into it. https://stackoverflow.com/help/how-to-ask – Philipp Jul 18 '18 at 14:28