View Full Version : saveRouteToCache returns false instead of true when save succeeds (Android)

17.09.2015, 17:50
saveRouteToCache returns false instead of true when save succeeds (Android)

Version 2.5 JavaDoc says:

public boolean saveRouteToCache(int routeID)
routeID - The id of the route, which can be obtained from SKRouteListener.onRouteCalculationCompleted(SKRout eInfo)
Returns: true for success false otherwise.

public void loadRouteFromCache(int routeID)
routeID - id of the route.

I calculated a route with 2 alternates and saved them to the cache.

for (int routeId : newRoutes) {
SKRouteManager.getInstance().saveRouteToCache(rout eId);
saveRouteToCache Route with ID 2806427 saved to cache = false
saveRouteToCache Route with ID 7000731 saved to cache = false
According to the status, it failed, but this works:

SKRouteManager.getInstance().loadRouteFromCache(mR outes.get(index).id);
loadRouteFromCache with ID = 2806427 from cache
loadRouteFromCache with ID = 7000731 from cache
What really confused me is that I originally tried the save using the wrong ID and got a success status, even though the routes weren't actually saved:

for (int i = 0 ; i < newRoutes.size() ; i++) {
saveRouteToCache Route with ID 0 saved to cache = true
saveRouteToCache Route with ID 1 saved to cache = true

23.09.2015, 08:34
Thank you ehartwell for reporting this.
We'll investigate it as soon as possible.

Update[28.10.2015]: we confirm that is was an issue on our side. The fix will be available in the next SDK update