Results 1 to 3 of 3

Thread: [Android] SKNavigationType.REAL - reportNewGPSPosition

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Etablierter skobbler
    Join Date
    08.01.2016
    Location
    Lübeck
    Posts
    20

    [Android] SKNavigationType.REAL - reportNewGPSPosition

    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.

    Code:
        @Override
        public void onAllRoutesCompleted() {
            System.out.println("onAllRoutesCompleted");
            SKNavigationSettings navigationSettings = new SKNavigationSettings();
            navigationSettings.setNavigationType(SKNavigationSettings.SKNavigationType.SIMULATION);
    
            SKNavigationManager navigationManager = SKNavigationManager.getInstance();
            navigationManager.setMapView(mapView);
            navigationManager.setNavigationListener(ActivityMap.this);
            navigationManager.startNavigation(navigationSettings);
            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:
    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().reportNewGPSPosition(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
    Attached Images Attached Images
    Last edited by PatrickZenker; 11.01.2016 at 11:03.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •