iamraymondchen
iamraymondchen

Reputation: 69

Here Maps Android SDK PositioningManager start method returns false

I'm using Here Maps on my Nexus 6P to test out their navigation routing logic. I've got the map setup and I'm currently trying to get my location to show up on the map.

Here maps v3.2.1 Premium Version running on Android 6.0.1

But every time I call the start method for PositioningManager instance I get a false return. Here is my code :

mapEngine.init(context, new OnEngineInitListener() {
        @Override
        public void onEngineInitializationCompleted(Error error) {
            if (error == OnEngineInitListener.Error.NONE) {

                setupMapView(mapView);

                // Start the positioning manager
                positioningManager = PositioningManager.getInstance();
                positioningManager.addListener(new WeakReference<PositioningManager.OnPositionChangedListener>(positionListener));

                if(positioningManager.start(PositioningManager.LocationMethod.GPS_NETWORK_INDOOR)){
                    Log.d(TAG, "LOCATION STARTED SUCCESSFUL");
                }else{
                    Log.d(TAG, "LOCATION STARTED UNSUCCESSFUL");
                }

                map.getPositionIndicator().setVisible(true);

                listener.onMapEngineCompleted(error);
            } else {
                // handle factory initialization failure
                Log.d(TAG, error.toString());
                Log.e(TAG, error.getDetails());
                Log.e(TAG, error.getStackTrace());
                listener.onMapEngineCompleted(error);
            }
        }
    }); 

I've also already got ACCESS_FINE_LOCATION permission granted from the system

Upvotes: 1

Views: 836

Answers (1)

elpatricko
elpatricko

Reputation: 508

As I ran into the same problem, I will put the answer from @Marco's comment here. If the positioningManager.start() method is returning false you may have to include this to your AndroidManifest.xml:

<service android:enabled="true" android:exported="false" android:name="com.here.services.internal.LocationService" android:process=":remote"/>

This fixed the issue for me.

Upvotes: 2

Related Questions