0

I am getting distance and time when drawing the route

double distance = m_mapRoute.getRoute ().getLength ();
double time = route.getTtaExcludingTraffic(Route.WHOLE_ROUTE).getDuration ();

Now the question is, i need to know how much distance and time is left to the finish while driving. I don't see any function in maneuver that provides this.

artonbej
  • 258
  • 4
  • 10

1 Answers1

0

You should be able to get them from NavigationManger.getTta(Route.TrafficPenaltyMode mode, boolean wholeRoute) and NavigationManger.getDestinationDistance()

Jithin Krishnan
  • 1,044
  • 1
  • 6
  • 6
  • I got but with some changes `long minutes = (m_navigationManager.getTta(Route.TrafficPenaltyMode.OPTIMAL, true).getDuration () % 3600) / 60;` But with some problems, if minutes are greater than 60 then it gives me wrong minutes... example if the whole route is 64 minutes then on navigation this function returns 8 minutes – artonbej Mar 22 '19 at 20:43
  • I think that is expected behavior, if duration is > 60 minutes , you should also check the 'hours' conversion for the seconds returned from SDK. ( https://stackoverflow.com/questions/25903354/java-convert-seconds-to-minutes-hours-and-days/25903874 ) – Jithin Krishnan Mar 26 '19 at 09:59