PatrickZenker
08.01.2016, 19:42
Hey Forum,
iam new in the Skobbler SDK world.
Ive followed the instructions of ""How to" for the Android SDK". The map is showed and i can rotate, zoom,...
Then i tryed the navigation module with "Navigating a route". When i use the example code snippet (see below), everything works fine.
@Override
public void onAllRoutesCompleted() {
System.out.println("onAllRoutesCompleted");
SKNavigationSettings navigationSettings = new SKNavigationSettings();
navigationSettings.setNavigationType(SKNavigationS ettings.SKNavigationType.SIMULATION);
SKNavigationManager navigationManager = SKNavigationManager.getInstance();
navigationManager.setMapView(mapView);
navigationManager.setNavigationListener(ActivityMa p.this);
navigationManager.startNavigation(navigationSettin gs);
skToolsNavigationInProgress = true;
}
After changing to SKNavigationType.REAL there is only the route displayed. Ive implemented my on location listener for adjusting LocationManager.requestLocationUpdates with different Criteria. After i received an location update i use the following code:
@Override
public void positionUpdate(LatLng currentPosition, float accuracy) {
SKPosition skPosition = new SKPosition(currentPosition.longitude, currentPosition.latitude, (double) 0.0, (double) accuracy, (double) 0.0, 0.0D, 0.0);
SKPositionerManager.getInstance().reportNewGPSPosi tion(this.currentPosition);
}
But now nothing happens with the initial current position of the calculated and displayed route. What am I doing wrong?
Im getting updates regularly with onUpdateNavigationState - it seems that something is working in the background but just without position updates.
As you can see in my attachments the current position is updated and showed as a SKAnnotation (left image is the first update (gps, very bad accuracy), right image the second (via wlan with good accuracy))
Best regards,
Patrick
iam new in the Skobbler SDK world.
Ive followed the instructions of ""How to" for the Android SDK". The map is showed and i can rotate, zoom,...
Then i tryed the navigation module with "Navigating a route". When i use the example code snippet (see below), everything works fine.
@Override
public void onAllRoutesCompleted() {
System.out.println("onAllRoutesCompleted");
SKNavigationSettings navigationSettings = new SKNavigationSettings();
navigationSettings.setNavigationType(SKNavigationS ettings.SKNavigationType.SIMULATION);
SKNavigationManager navigationManager = SKNavigationManager.getInstance();
navigationManager.setMapView(mapView);
navigationManager.setNavigationListener(ActivityMa p.this);
navigationManager.startNavigation(navigationSettin gs);
skToolsNavigationInProgress = true;
}
After changing to SKNavigationType.REAL there is only the route displayed. Ive implemented my on location listener for adjusting LocationManager.requestLocationUpdates with different Criteria. After i received an location update i use the following code:
@Override
public void positionUpdate(LatLng currentPosition, float accuracy) {
SKPosition skPosition = new SKPosition(currentPosition.longitude, currentPosition.latitude, (double) 0.0, (double) accuracy, (double) 0.0, 0.0D, 0.0);
SKPositionerManager.getInstance().reportNewGPSPosi tion(this.currentPosition);
}
But now nothing happens with the initial current position of the calculated and displayed route. What am I doing wrong?
Im getting updates regularly with onUpdateNavigationState - it seems that something is working in the background but just without position updates.
As you can see in my attachments the current position is updated and showed as a SKAnnotation (left image is the first update (gps, very bad accuracy), right image the second (via wlan with good accuracy))
Best regards,
Patrick