I am making the app with your sygic sdk in android. I got an error in Routing please help to solve that. I am coding according to your documentation.
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
package com.example.sygicdemo5;
MapFragment mapFragment;
MapView mMapView;
RoutePlan mRoute;
Router mRouter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mapFragment = (MapFragment) getSupportFragmentManager().findFragmentById(R.id.mapFragment);
// getMapAsync() will internally wait for engine initialization
mapFragment.getMapAsync(new OnMapInitListener() {
@Override
public void onMapInitializationInterrupted() {
}
@Override
public void onMapReady(@NonNull MapView mapView) {
// Now you can start work with the ready mapView object
OnlineManager.getInstance().enableOnlineMapStreaming(true);
setTheLocation();
}
});
}
public void setTheLocation(){
mMapView = mapFragment.getMapView();
mMapView.getCameraModel().setPosition(new GeoCoordinates(28.4595, 77.0266));
mMapView.getCameraModel().setZoomLevel(18.5f);
setTheRoute();
}
public void setTheRoute(){
mRoute = new RoutePlan();
mRoute.setStart(new GeoCoordinates(28.4595, 77.0266));
mRoute.setDestination(new GeoCoordinates(28.4291,77.0367));
mRouter = new Router();
mRouter.computeRoute(mRoute, new Router.RouteComputeAdapter() {
@Override
public void onComputeError(Router router, int error) {
super.onComputeError(router, error);
// here the code stops with error code 4 (Unreachable target)
}
@Override
public void onProgress(Router router, int progress, long routeId) {
super.onProgress(router, progress, routeId);
}
@Override
public void onComputeStarted(Router router) {
super.onComputeStarted(router);
}
@Override
public void onPrimaryComputeFinished(Router router, RouteInfo routes) {
super.onPrimaryComputeFinished(router, routes);
}
@Override
public void onAlternativeComputeFinished(Router router, RouteInfo routes) {
super.onAlternativeComputeFinished(router, routes);
}
@Override
public void onComputeFinished(Router router) {
super.onComputeFinished(router);
}
@Override
public void onRecomputeStarted() {
super.onRecomputeStarted();
}
@Override
public void onRecomputeFinished(RouteInfo route, int recomputeType) {
super.onRecomputeFinished(route, recomputeType);
}
@Override
public void onRecomputeError(int error) {
super.onRecomputeError(error);
}
});
}